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.
26 lines
613 B
26 lines
613 B
from swarms import Agent
|
|
from swarms.structs.swarm_router import SwarmRouter
|
|
|
|
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 = SwarmRouter(
|
|
name="multi-agent-router-demo",
|
|
description="Routes tasks to the most suitable agent",
|
|
agents=agents,
|
|
swarm_type="MultiAgentRouter",
|
|
)
|
|
|
|
result = router.run("Write a function that adds two numbers")
|
|
print(result)
|