GroupChatfunction_map
.\{roles}
” it will replaced with the agent’s and their role descriptions. If the string contains “\{agentlist}
” it will be replaced with a comma-separated list of agent names in square brackets. The default value is: \{roles}
.\{agentlist}
to play. Only return the role.”
\{agentlist}
” it will be replaced with a comma-separated list of agent names in square brackets. The default value is: \{agentlist}
to play. Only return the role.”
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.\{agentlist}
” it will be replaced with a comma-separated list of agent names in square brackets. The default value is: \{agentlist}
” it will be replaced with a comma-separated list of agent names in square brackets. The default value is: \{agentlist}
.agents
.Agent
class, it must be one of the agents in the group chat.python def custom_speaker_selection_func( last_speaker: Agent, groupchat: GroupChat ) -> Union[Agent, str, None]: <br/>
allow_repeat_speaker
is a list of Agents, then only those listed agents are allowed to repeat.allow_repeat_speaker
and allowed_or_disallowed_speaker_transitions
are mutually exclusive.allow_repeat_speaker
and allowed_or_disallowed_speaker_transitions
are mutually exclusive.allowed_or_disallowed_speaker_transitions
is a dictionary containing lists of allowed agents.allowed_or_disallowed_speaker_transitions
is a dictionary containing lists of disallowed agents.allowed_or_disallowed_speaker_transitions
is not None.Name | Description |
---|---|
agents | Type: list[Agent] |
messages | Type: list[dict[str, typing.Any]] Default: <factory> |
max_round | Type: int Default: 10 |
admin_name | Type: str Default: ‘Admin’ |
func_call_filter | Type: bool Default: True |
speaker_selection_method | Type: Literal[‘auto’, ‘manual’, ‘random’, ‘round_robin’] | Callable[…, Any] Default: ‘auto’ |
max_retries_for_selecting_speaker | Type: int Default: 2 |
allow_repeat_speaker | Type: bool | list[Agent] | None Default: None |
allowed_or_disallowed_speaker_transitions | Type: dict[str, typing.Any] | None Default: None |
speaker_transitions_type | Type: Literal[‘allowed’, ‘disallowed’, None] Default: None |
enable_clear_history | Type: bool Default: False |
send_introductions | Type: bool Default: False |
select_speaker_message_template | Type: str Default: ‘You are in a role play game. The following roles are available |
select_speaker_prompt_template | Type: str Default: ‘Read the above conversation. Then select the next role from {agentlist} to play. Only return the role.‘ |
select_speaker_auto_multiple_template | Type: str Default: ‘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 |
select_speaker_auto_none_template | Type: str Default: ‘You didn’t choose a speaker. As a reminder, to determine the speaker use these prioritised rules |
select_speaker_transform_messages | Type: TransformMessages | None Default: None |
select_speaker_auto_verbose | Type: bool | None Default: False |
select_speaker_auto_model_client_cls | Type: ModelClient | list[ModelClient] | None Default: None |
select_speaker_auto_llm_config | Type: LLMConfig | dict[str, typing.Any] | Literal[False] | None Default: None |
role_for_select_speaker_messages | Type: str | None Default: ‘system’ |
Name | Description |
---|---|
last_speaker | The previous speaker in the group chat Type: Agent |
selector | The ConversableAgent that initiated the speaker selection Type: ConversableAgent |
messages | Current chat messages Type: list[dict[str, typing.Any]] | None |
agents | Valid list of agents for speaker selection Type: list[Agent] | None |
Type | Description |
---|---|
Agent | A counter for mentioned agents. |
Name | Description |
---|---|
last_speaker | Type: Agent |
selector | Type: ConversableAgent |
Name | Description |
---|---|
name | Type: str |
recursive | Type: bool Default: False |
raise_on_name_conflict | Type: bool Default: False |
Name | Description |
---|---|
message | Type: dict[str, typing.Any] |
speaker | Type: Agent |
Name | Description |
---|---|
agents | Type: list[Agent] | None Default: None |
Name | Description |
---|---|
agents | Type: list[Agent] | None Default: None |
Name | Description |
---|---|
agent | Type: Agent |
agents | Type: list[Agent] | None Default: None |
Name | Description |
---|---|
agents | Type: list[Agent] | None Default: None |
Name | Description |
---|---|
last_speaker | Type: Agent |
selector | Type: ConversableAgent |
Name | Description |
---|---|
agents | Type: list[Agent] | None Default: None |
Name | Description |
---|---|
agents | Type: list[Agent] | None Default: None |