Swarm-readme-14.py
· 244 B · Python
Brut
sales_agent = Agent(name="Sales Agent")
def transfer_to_sales():
return sales_agent
agent = Agent(functions=[transfer_to_sales])
response = client.run(agent, [{"role":"user", "content":"Transfer me to sales."}])
print(response.agent.name)
1 | sales_agent = Agent(name="Sales Agent") |
2 | |
3 | def transfer_to_sales(): |
4 | return sales_agent |
5 | |
6 | agent = Agent(functions=[transfer_to_sales]) |
7 | |
8 | response = client.run(agent, [{"role":"user", "content":"Transfer me to sales."}]) |
9 | print(response.agent.name) |