Agent
class follow the same structure as the OpenAI Agents SDK Agent
. However, there are a few advanced parameters that require more explanation.
Parallel Tool Calls
Controls whether tools execute in parallel or sequentially for a given agent.one_call_at_a_time = True
in the tool’s ToolConfig
. See Advanced Tool Configuration.
File Search
If yourfiles_folder
ends with _vs_<vector_store_id>
, Agency Swarm automatically associates files with that Vector Store and adds FileSearchTool
to the Agent. The include_search_results
behavior can be toggled via the Agent’s include_search_results
flag.
Note: in v0.x you could configure file_search
directly on the Agent (Assistants API). In v1.x prefer the files_folder
+ Vector Store convention.
File Search Configuration (v0.x)
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.
Output Validation
v1.x (Agents SDK): Useoutput_guardrails
on the Agent
to validate outputs. See the detailed guide: Output Validation. For a complete working example, see: examples/response_validation.py.
v0.x (Response Validator): You can validate responses before sending them to the user or other agents by defining a response_validator
method on the Agent. This method should raise an error if the response is invalid, allowing the agent to correct itself.
Few‑Shot Examples
Few‑shot examples are supported and appended toinstructions
at initialization. The format follows the message object format.