Utoljára aktív 1728945951

Swarm-readme-10.py Eredeti
1def instructions(context_variables):
2 user_name = context_variables["user_name"]
3 return f"Help the user, {user_name}, do whatever they want."
4
5agent = Agent(
6 instructions=instructions
7)
8response = client.run(
9 agent=agent,
10 messages=[{"role":"user", "content": "Hi!"}],
11 context_variables={"user_name":"John"}
12)
13print(response.messages[-1]["content"])