Advanced Configuration
Learn advanced configuration options for your agents in Agency Swarm.
All parameters inside the Agent
class, follow the same structure as OpenAI’s Assistants API. However, there are a few advanced parameters that require more explanation.
Parallel Tool Calls
Whether to run tools in parallel or sequentially. By default, this parameter is set to True
.
File Search Configuration
File search configuration for the agent, as described in the OpenAI documentation.
Parameters:
max_num_results
: The maximum number of results the file search tool should output. The default is 20 forgpt-4*
models and 5 forgpt-3.5-turbo
. This number should be between 1 and 50 inclusive. Note that the file search tool may output fewer thanmax_num_results
results.ranking_options
: The ranking options for the file search. If not specified, the file search tool will use theauto
ranker and a score_threshold of 0. See the file search tool documentation for more information.
Response Validator
This is a special function that allows you to validate the response before sending it to the user or another agent. This function should raise an error if the response is invalid. The agent will then see this error as the user message and try correct itself accordingly.
Few-Shot Examples
Few-show examples help the agent to understand how to respond. The format for examples follows message object format on OpenAI: