diff --git a/examples/multi_agent/mar/multi_agent_router_minimal.py b/examples/multi_agent/mar/multi_agent_router_minimal.py index 2930c175..898ccef3 100644 --- a/examples/multi_agent/mar/multi_agent_router_minimal.py +++ b/examples/multi_agent/mar/multi_agent_router_minimal.py @@ -1,19 +1,25 @@ -from swarms import Agent, MultiAgentRouter +from swarms import Agent +from swarms.structs.swarm_router import SwarmRouter -if __name__ == "__main__": - agents = [ - Agent( - agent_name="Researcher", - system_prompt="Answer questions briefly.", - model_name="gpt-4o-mini", - ), - Agent( - agent_name="Coder", - system_prompt="Write small Python functions.", - model_name="gpt-4o-mini", - ), - ] +agents = [ + Agent( + agent_name="Researcher", + system_prompt="Answer questions briefly.", + model_name="gpt-4o-mini", + ), + Agent( + agent_name="Coder", + system_prompt="Write small Python functions.", + model_name="gpt-4o-mini", + ), +] - router = MultiAgentRouter(agents=agents) +router = SwarmRouter( + name="multi-agent-router-demo", + description="Routes tasks to the most suitable agent", + agents=agents, + swarm_type="MultiAgentRouter" +) - result = router.route_task("Write a function that adds two numbers") +result = router.run("Write a function that adds two numbers") +print(result) \ No newline at end of file