GroupManager
Group chat manager agent.
WaldiezGroupManager
¶
Bases: WaldiezAgent
Group chat manager agent.
A WaldiezAgent
with agent_type manager
, human_input_mode
: "NEVER"
and chat group related config for the agent. Also see WaldiezAgent
, WaldiezGroupManagerData
, WaldiezAgentData
Attributes:
Name | Type | Description |
---|---|---|
agent_type | Literal['manager'] | The agent type: 'manager' for a group manager agent |
data | WaldiezGroupManagerData | The group manager agent's data. |
Methods:
Name | Description |
---|---|
validate_transitions | Validate the transitions. |
validate_transitions(agent_ids: List[str]) -> None
¶
Validate the transitions.
If the selection mode is transition
:
- if
allow_repeat
is a list of agent_ids, make sure these ids exist. - make sure the
allowed_or_disallowed_transitions
mapping has valid agent ids.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
agent_ids | List[str] | The list of agent IDs. | required |
Raises:
Type | Description |
---|---|
ValueError | If the transitions are invalid. |
Source code in waldiez/models/agents/group_manager/group_manager.py
Group chat manager data.
WaldiezGroupManagerData
¶
Bases: WaldiezAgentData
Group chat manager data class.
The data for an agent with human_input_mode
set to "NEVER" as default. and the chat group's related extra properties. See the parent's docs (WaldiezAgentData
) for the rest of the properties.
Attributes:
Name | Type | Description |
---|---|---|
human_input_mode | Literal['ALWAYS', 'NEVER', 'TERMINATE'] | The human input mode, Defaults to |
max_round | Optional[int] | The maximum number of rounds to have in the group. |
admin_name | Optional[str] | The name of the group's admin. Make sure you use a name of an agent in the group. |
speakers | WaldiezGroupManagerSpeakers | The rules for the speaker selection and repetition |
enable_clear_history | Optional[bool] | Enable clearing the history in the chat group. |
send_introductions | bool | Send the group members' introductions. |
Group chat speakers.
WaldiezGroupManagerSpeakers
¶
Bases: WaldiezBase
Group chat speakers.
If the method for the speaker selection is custom
the selection_custom_method
contents (source code) will be used. The method must be called custom_speaker_selection
, have two arguments:
- last_speaker:
autogen.ConversableAgent
- groupchat:
autogen.GroupChat
and return a Union[Agent, str, None]
Attributes:
Name | Type | Description |
---|---|---|
selection_method | WaldiezGroupManagerSpeakersSelectionMethod | The next speaker selection method. |
selection_custom_method | Optional[str] | Method for custom selection. |
max_retries_for_selecting | Optional[int] | Max retries for selecting a speaker. |
selection_mode | WaldiezGroupManagerSpeakersSelectionMode | Selection mode. |
allow_repeat | Union[bool, List[str]] | Allow repeat. |
allowed_or_disallowed_transitions | Dict[str, List[str]] | Allowed or disallowed transitions. |
transitions_type | WaldiezGroupManagerSpeakersTransitionsType | The type of transition rules to use if if a mapping (agent => List[agents]) is used: |
custom_method_string | Optional[str] | The custom method string. |
Methods:
Name | Description |
---|---|
validate_group_speakers_config | Validate the speakers config. |
custom_method_string: Optional[str]
property
¶
get_custom_method_function(name_prefix: Optional[str] = None, name_suffix: Optional[str] = None) -> Tuple[str, str]
¶
Get the custom method function.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name_prefix | str | The function name prefix. | None |
name_suffix | str | The function name suffix. | None |
Returns:
Type | Description |
---|---|
Tuple[str, str] | The custom method function and the function name. |
Source code in waldiez/models/agents/group_manager/speakers.py
validate_group_speakers_config() -> Self
¶
Validate the speakers config.
Returns:
Type | Description |
---|---|
GroupManagerSpeakers | The group manager speakers config. |
Raises:
Type | Description |
---|---|
ValueError | If the custom method is invalid. |
Source code in waldiez/models/agents/group_manager/speakers.py
WaldiezGroupManagerSpeakersSelectionMethod = Literal['auto', 'manual', 'random', 'round_robin', 'custom']
module-attribute
¶
Possible methods for the speaker selection.
WaldiezGroupManagerSpeakersSelectionMode = Literal['repeat', 'transition']
module-attribute
¶
Possible selection modes: repeat, transition.
WaldiezGroupManagerSpeakersTransitionsType = Literal['allowed', 'disallowed']
module-attribute
¶
Possible transitions types: allowed, disallowed.