Guide for migrating from Agency Swarm v0.x to v1.x (OpenAI Agents SDK based)
@function_tool
decorator replaces complex BaseTool classesπ Complete Feature Comparison
output_guardrails
and input_guardrails
systemcommunication_flows
for coordinated multi-agent executionoutput_type
@function_tool
decorator replaces BaseTool
classes for cleaner tool definitionsoutput_guardrails
and input_guardrails
replace the old response_validator
systemποΈ Understanding the Migration
agents.Runner
from OpenAI Agents SDK for more controlThreadManager
and MessageStore
managed via RunHooks
and shared MasterContext
Agent
class with Assistants API integrationagency_swarm.Agent
extends agents.Agent
, incorporating tools, subagent registration, and file handlingthreads_callbacks
dict β separate load_threads_callback
and save_threads_callback
parametersπ§ Agency & Agent Updates
π οΈ Tool Migration
π Interaction Updates
π API changes overview
v0.x | Status | v1.x alternative |
---|---|---|
get_completion() | β Backward compatible | get_response() (async) |
get_completion_stream() | β Removed | get_response_stream() (async) |
agency_chart | β οΈ Deprecated | Positional args + communication_flows |
threads_callbacks | β Breaking change | load_threads_callback + save_threads_callback |
v0.x | Status | v1.x alternative |
---|---|---|
temperature , top_p , etc. | β οΈ Individual params deprecated | model_settings=ModelSettings(...) |
response_validator | β Removed | output_guardrails , input_guardrails |
response_format | β Removed | output_type |
examples | β οΈ Deprecated | Auto-prepended to instructions |
v0.x | Status | v1.x alternative |
---|---|---|
BaseTool classes | β οΈ BaseTool still works | @function_tool decorator (recommended) |
run() method | β Simplified | Direct function body implementation |
_shared_state | β Enhanced | ctx.context |