You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add support for list of messages as team task input and update Society of Mind Agent (#4500)
* feat: add support for list of messages as team task input
* Update society of mind agent to use the list input task
---------
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Ryan Sweet <[email protected]>
Co-authored-by: Eric Zhu <[email protected]>
agent3 = AssistantAgent("assistant3", model_client=model_client, system_message="You are a helpful assistant.")
59
-
agent4 = AssistantAgent("assistant4", model_client=model_client, system_message="You are a helpful assistant.")
60
-
outter_termination = MaxMessageTermination(10)
61
-
team = RoundRobinGroupChat([society_of_mind_agent, agent3, agent4], termination_condition=outter_termination)
67
+
agent3 = AssistantAgent(
68
+
"assistant3", model_client=model_client, system_message="Translate the text to Spanish."
69
+
)
70
+
team = RoundRobinGroupChat([society_of_mind_agent, agent3], max_turns=2)
62
71
63
-
stream = team.run_stream(task="Tell me a one-liner joke.")
64
-
async for message in stream:
65
-
print(message)
72
+
stream = team.run_stream(task="Write a short story with a surprising ending.")
73
+
await Console(stream)
66
74
67
75
68
76
asyncio.run(main())
69
77
"""
70
78
79
+
DEFAULT_INSTRUCTION="Earlier you were asked to fulfill a request. You and your team worked diligently to address that request. Here is a transcript of that conversation:"
80
+
"""str: The default instruction to use when generating a response using the
81
+
inner team's messages. The instruction will be prepended to the inner team's
82
+
messages when generating a response using the model. It assumes the role of
83
+
'system'."""
84
+
85
+
DEFAULT_RESPONSE_PROMPT= (
86
+
"Output a standalone response to the original request, without mentioning any of the intermediate discussion."
87
+
)
88
+
"""str: The default response prompt to use when generating a response using
89
+
the inner team's messages. It assumes the role of 'system'."""
90
+
71
91
def__init__(
72
92
self,
73
93
name: str,
74
94
team: Team,
75
95
model_client: ChatCompletionClient,
76
96
*,
77
97
description: str="An agent that uses an inner team of agents to generate responses.",
78
-
task_prompt: str="{transcript}\nContinue.",
79
-
response_prompt: str="Here is a transcript of conversation so far:\n{transcript}\n\\Provide a response to the original request.",
0 commit comments