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
Copy file name to clipboardExpand all lines: autogen/agentchat/groupchat.py
+39-9
Original file line number
Diff line number
Diff line change
@@ -39,6 +39,7 @@ class GroupChat:
39
39
Then select the next role from {agentlist} to play. Only return the role."
40
40
- select_speaker_prompt_template: customize the select speaker prompt (used in "auto" speaker selection), which appears last in the message context and generally includes the list of agents and guidance for the LLM to select the next agent. If the string contains "{agentlist}" it will be replaced with a comma-separated list of agent names in square brackets. The default value is:
41
41
"Read the above conversation. Then select the next role from {agentlist} to play. Only return the role."
42
+
To ignore this prompt being used, set this to None. If set to None, ensure your instructions for selecting a speaker are in the select_speaker_message_template string.
42
43
- select_speaker_auto_multiple_template: customize the follow-up prompt used when selecting a speaker fails with a response that contains multiple agent names. This prompt guides the LLM to return just one agent name. Applies only to "auto" speaker selection method. If the string contains "{agentlist}" it will be replaced with a comma-separated list of agent names in square brackets. The default value is:
43
44
"You provided more than one name in your text, please return just the name of the next speaker. To determine the speaker use these prioritised rules:
44
45
1. If the context refers to themselves as a speaker e.g. "As the..." , choose that speaker's name
# NOTE: Do we have a speaker prompt (select_speaker_prompt_template is not None)? If we don't, we need to feed in the last message to start the nested chat
635
+
627
636
# Agent for selecting a single agent name from the response
628
637
speaker_selection_agent=ConversableAgent(
629
638
"speaker_selection_agent",
630
639
system_message=self.select_speaker_msg(agents),
631
-
chat_messages={checking_agent: messages},
640
+
chat_messages=(
641
+
{checking_agent: messages}
642
+
ifself.select_speaker_prompt_templateisnotNone
643
+
else {checking_agent: messages[:-1]}
644
+
),
632
645
llm_config=selector.llm_config,
633
646
human_input_mode="NEVER", # Suppresses some extra terminal outputs, outputs will be handled by select_speaker_auto_verbose
# NOTE: Do we have a speaker prompt (select_speaker_prompt_template is not None)? If we don't, we need to feed in the last message to start the nested chat
734
+
714
735
# Agent for selecting a single agent name from the response
0 commit comments