You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
swarms/examples/multi_agent/mar/multi_agent_router_minimal.py

21 lines
593 B

from swarms import Agent, MultiAgentRouter
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",
),
]
router = MultiAgentRouter(agents=agents)
result = router.route_task("Write a function that adds two numbers")
print("Chosen agent:", result["boss_decision"]["selected_agent"])