mirror of
https://github.com/microsoft/autogen.git
synced 2025-11-01 18:29:49 +00:00
fix & doc: update selector prompt documentation and remove validation checks (#5456)
This commit is contained in:
parent
15891e8cef
commit
b5eaab8501
@ -259,7 +259,7 @@ class SelectorGroupChat(BaseGroupChat, Component[SelectorGroupChatConfig]):
|
||||
Without a termination condition, the group chat will run indefinitely.
|
||||
max_turns (int, optional): The maximum number of turns in the group chat before stopping. Defaults to None, meaning no limit.
|
||||
selector_prompt (str, optional): The prompt template to use for selecting the next speaker.
|
||||
Must contain '{roles}', '{participants}', and '{history}' to be filled in.
|
||||
Available fields: '{roles}', '{participants}', and '{history}'.
|
||||
allow_repeated_speaker (bool, optional): Whether to include the previous speaker in the list of candidates to be selected for the next turn.
|
||||
Defaults to False. The model may still select the previous speaker -- a warning will be logged if this happens.
|
||||
max_selector_attempts (int, optional): The maximum number of attempts to select a speaker using the model. Defaults to 3.
|
||||
@ -418,13 +418,6 @@ Read the above conversation. Then select the next role from {participants} to pl
|
||||
# Validate the participants.
|
||||
if len(participants) < 2:
|
||||
raise ValueError("At least two participants are required for SelectorGroupChat.")
|
||||
# Validate the selector prompt.
|
||||
if "{roles}" not in selector_prompt:
|
||||
raise ValueError("The selector prompt must contain '{roles}'")
|
||||
if "{participants}" not in selector_prompt:
|
||||
raise ValueError("The selector prompt must contain '{participants}'")
|
||||
if "{history}" not in selector_prompt:
|
||||
raise ValueError("The selector prompt must contain '{history}'")
|
||||
self._selector_prompt = selector_prompt
|
||||
self._model_client = model_client
|
||||
self._allow_repeated_speaker = allow_repeated_speaker
|
||||
|
||||
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user