Understanding agencies in Agency Swarm.
Agency
class:
Name | Parameter | Description |
---|---|---|
Agency Chart | agency_chart | A list that defines the hierarchy and interaction patterns between agents. It specifies: 1. Individual agents that can interact with users 2. Agent pairs that can communicate with each other Example: [agent1, [agent1, agent2]] - agent1 has user interaction permissions- agent1 can communicate with agent2 |
Shared Instructions (optional) | shared_instructions | Path to a file containing instructions shared across all agents. Can be a relative path from the agency’s folder or an absolute path. Default: empty string |
Shared Files (optional) | shared_files | Path to a folder or list of folders containing files accessible by all agents. These files are added to each agent’s files folder. Default: None |
Async Mode (optional) | async_mode | Specifies the asynchronous processing mode. Options: - "threading" : All sub-agents run in separate threads- "tools_threading" : All tools run in separate threads, but agents do notDefault: None |
Settings Path (optional) | settings_path | Path to the JSON settings file for the agency. If file doesn’t exist, it will be created. Default: "./settings.json" |
Settings Callbacks (optional) | settings_callbacks | Dictionary containing functions to load and save settings. Must include both "load" and "save" functions. Both functions must be defined. Default: None |
Threads Callbacks (optional) | threads_callbacks | Dictionary containing functions to load and save threads. Must include both "load" and "save" functions. Both functions must be defined. Default: None |
Temperature (optional) | temperature | Controls response randomness (0.0 to 1.0). Agent-specific values override this. Lower values make responses more focused and deterministic. Default: 0.3 |
Top P (optional) | top_p | Alternative to temperature for controlling response randomness (0.0 to 1.0). Agent-specific values override this. Default: 1.0 |
Max Prompt Tokens (optional) | max_prompt_tokens | Maximum tokens allowed in the prompt for each agent. Agent-specific values override this. Default: None |
Max Completion Tokens (optional) | max_completion_tokens | Maximum tokens allowed in the completion for each agent. Agent-specific values override this. Default: None |
Truncation Strategy (optional) | truncation_strategy | Dictionary configuring how to handle token limits. Agent-specific values override this. See OpenAI documentation for details. Default: None |