Última atividade 1728946220

wangold revisou este gist 1728946220. Ir para a revisão

1 file changed, 19 insertions

Swarm-readme-16.py(arquivo criado)

@@ -0,0 +1,19 @@
1 + sales_agent = Agent(name="Sales Agent")
2 +
3 + def talk_to_sales():
4 + print("Hello, World!")
5 + return Result(
6 + value="Done",
7 + agent=sales_agent,
8 + context_variables={"department": "sales"}
9 + )
10 +
11 + agent = Agent(functions=[talk_to_sales])
12 +
13 + response = client.run(
14 + agent=agent,
15 + messages=[{"role": "user", "content": "Transfer me to sales"}],
16 + context_variables={"user_name": "John"}
17 + )
18 + print(response.agent.name)
19 + print(response.context_variables)
Próximo Anterior