Skip to content

Commit 7811b1c

Browse files
authored
[doc] Clarify selector prompt for SelectorGroupChat (microsoft#6399)
Resolves microsoft#6383
1 parent 7bdd7f6 commit 7811b1c

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

python/packages/autogen-agentchat/src/autogen_agentchat/teams/_group_chat/_selector_group_chat.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,9 @@ class SelectorGroupChat(BaseGroupChat, Component[SelectorGroupChatConfig]):
328328
max_turns (int, optional): The maximum number of turns in the group chat before stopping. Defaults to None, meaning no limit.
329329
selector_prompt (str, optional): The prompt template to use for selecting the next speaker.
330330
Available fields: '{roles}', '{participants}', and '{history}'.
331+
`{participants}` is the names of candidates for selection. The format is `["<name1>", "<name2>", ...]`.
332+
`{roles}` is a newline-separated list of names and descriptions of the candidate agents. The format for each line is: `"<name> : <description>"`.
333+
`{history}` is the conversation history formatted as a double newline separated of names and message content. The format for each message is: `"<name> : <message content>"`.
331334
allow_repeated_speaker (bool, optional): Whether to include the previous speaker in the list of candidates to be selected for the next turn.
332335
Defaults to False. The model may still select the previous speaker -- a warning will be logged if this happens.
333336
max_selector_attempts (int, optional): The maximum number of attempts to select a speaker using the model. Defaults to 3.

python/packages/autogen-core/docs/src/user-guide/agentchat-user-guide/selector-group-chat.ipynb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,11 @@
272272
"cell_type": "markdown",
273273
"metadata": {},
274274
"source": [
275+
"The string variables available in the selector prompt are:\n",
276+
"- `{participants}`: The names of candidates for selection. The format is `[\"<name1>\", \"<name2>\", ...]`.\n",
277+
"- `{roles}`: A newline-separated list of names and descriptions of the candidate agents. The format for each line is: `\"<name> : <description>\"`.\n",
278+
"- `{history}`: The conversation history formatted as a double newline separated of names and message content. The format for each message is: `\"<name> : <message content>\"`.\n",
279+
"\n",
275280
"```{tip}\n",
276281
"Try not to overload the model with too much instruction in the selector prompt.\n",
277282
"\n",
@@ -1018,7 +1023,7 @@
10181023
"name": "python",
10191024
"nbconvert_exporter": "python",
10201025
"pygments_lexer": "ipython3",
1021-
"version": "3.12.9"
1026+
"version": "3.12.3"
10221027
}
10231028
},
10241029
"nbformat": 4,

0 commit comments

Comments
 (0)