RoundRobinPattern

RoundRobinPattern(
    initial_agent: ConversableAgent,
    agents: list['ConversableAgent'],
    user_agent: ForwardRef('ConversableAgent') | None = None,
    group_manager_args: dict[str, Any] | None = None,
    context_variables: ContextVariables | None = None,
    group_after_work: TransitionTarget | None = None,
    exclude_transit_message: bool = True,
    summary_method: str | Callable[..., Any] | None = 'last_msg'
)

RoundRobinPattern implements a round robin with handoffs between agents.
Initialize the pattern with the required components.

Parameters:
NameDescription
initial_agentType: ConversableAgent
agentsType: list[‘ConversableAgent’]
user_agentType: ForwardRef(‘ConversableAgent’) | None

Default: None
group_manager_argsType: dict[str, typing.Any] | None

Default: None
context_variablesType: ContextVariables | None

Default: None
group_after_workType: TransitionTarget | None

Default: None
exclude_transit_messageType: bool

Default: True
summary_methodType: str | Callable[…, Any] | None

Default: ‘last_msg’

Static Methods

create_default

create_default(
    initial_agent: ConversableAgent,
    agents: list['ConversableAgent'],
    user_agent: ForwardRef('ConversableAgent') | None = None,
    group_manager_args: dict[str, Any] | None = None,
    context_variables: ContextVariables | None = None,
    exclude_transit_message: bool = True,
    summary_method: str | Callable[..., Any] | None = 'last_msg'
) -> 

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.

Parameters:
NameDescription
initial_agentThe first agent to speak in the group chat.

Type: ConversableAgent
agentsList of all agents participating in the chat.

Type: list[‘ConversableAgent’]
user_agentOptional user proxy agent.

Type: ForwardRef(‘ConversableAgent’) | None

Default: None
group_manager_argsOptional arguments for the GroupChatManager.

Type: dict[str, typing.Any] | None

Default: None
context_variablesInitial context variables for the chat.

Type: ContextVariables | None

Default: None
exclude_transit_messageWhether to exclude transit messages from the conversation.

Type: bool

Default: True
summary_methodMethod for summarizing the conversation.

Type: str | Callable[…, Any] | None

Default: ‘last_msg’

Instance Methods

prepare_group_chat

prepare_group_chat(
    self,
    max_rounds: int,
    messages: list[dict[str, Any]] | str
) -> Tuple[list['ConversableAgent'], list['ConversableAgent'], ConversableAgent | None, ContextVariables, ConversableAgent, TransitionTarget, GroupToolExecutor, GroupChat, GroupChatManager, list[dict[str, Any]], Any, list[str], list[Any]]

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

Parameters:
NameDescription
max_roundsMaximum number of conversation rounds.

Type: int
messagesInitial message(s) to start the conversation.

Type: list[dict[str, typing.Any]] | str
Returns:
TypeDescription
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.