wangold ha revisionato questo gist . Vai alla revisione
1 file changed, 13 insertions
Swarm-readme-10.py(file creato)
@@ -0,0 +1,13 @@ | |||
1 | + | def instructions(context_variables): | |
2 | + | user_name = context_variables["user_name"] | |
3 | + | return f"Help the user, {user_name}, do whatever they want." | |
4 | + | ||
5 | + | agent = Agent( | |
6 | + | instructions=instructions | |
7 | + | ) | |
8 | + | response = client.run( | |
9 | + | agent=agent, | |
10 | + | messages=[{"role":"user", "content": "Hi!"}], | |
11 | + | context_variables={"user_name":"John"} | |
12 | + | ) | |
13 | + | print(response.messages[-1]["content"]) |
Più nuovi
Più vecchi