patterns
autogen.agentchat.group.patterns.DefaultPattern
DefaultPattern
DefaultPattern implements a minimal pattern for simple agent interactions.
This replaces the previous BasePattern and provides a concrete implementation
of the Pattern abstract base class.
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 with default configuration.
This implementation calls the parent class method but ensures that
the group_after_work in the returned tuple is the pattern’s own.
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. |