round_robin
autogen.agentchat.group.patterns.round_robin.RoundRobinPattern
RoundRobinPattern
RoundRobinPattern implements a round robin with handoffs between agents.
Initialize the pattern with the required components.
Name | Description |
---|---|
initial_agent | Type: ConversableAgent |
agents | Type: list[‘ConversableAgent’] |
user_agent | Type: ForwardRef(‘ConversableAgent’) | None Default: None |
group_manager_args | Type: dict[str, typing.Any] | None Default: None |
context_variables | Type: ContextVariables | None Default: None |
group_after_work | Type: TransitionTarget | None Default: None |
exclude_transit_message | Type: bool Default: True |
summary_method | Type: str | Callable[…, Any] | None Default: ‘last_msg’ |
Static Methods
create_default
Create a default pattern with minimal configuration.
This replaces the need for a separate BasePattern class by providing
a factory method that creates a simple DefaultPattern instance.
Name | Description |
---|---|
initial_agent | The first agent to speak in the group chat. Type: ConversableAgent |
agents | List of all agents participating in the chat. Type: list[‘ConversableAgent’] |
user_agent | Optional user proxy agent. Type: ForwardRef(‘ConversableAgent’) | None Default: None |
group_manager_args | Optional arguments for the GroupChatManager. Type: dict[str, typing.Any] | None Default: None |
context_variables | Initial context variables for the chat. Type: ContextVariables | None Default: None |
exclude_transit_message | Whether to exclude transit messages from the conversation. Type: bool Default: True |
summary_method | Method for summarizing the conversation. Type: str | Callable[…, Any] | None Default: ‘last_msg’ |
Instance Methods
prepare_group_chat
Prepare the group chat for organic agent selection.
Ensures that:
1. The group manager has a valid LLM config
2. All agents have appropriate descriptions for the group manager to use
Name | Description |
---|---|
max_rounds | Maximum number of conversation rounds. Type: int |
messages | Initial message(s) to start the conversation. Type: list[dict[str, typing.Any]] | str |
Type | Description |
---|---|
Tuple[list[‘ConversableAgent’], list[‘ConversableAgent’], ConversableAgent | None, ContextVariables, ConversableAgent, TransitionTarget, GroupToolExecutor, GroupChat, GroupChatManager, list[dict[str, Any]], Any, list[str], list[Any]] | Tuple containing all necessary components for the group chat. |