DefaultPattern
autogen.agentchat.group.patterns.pattern.DefaultPattern #
DefaultPattern(initial_agent, agents, user_agent=None, group_manager_args=None, context_variables=None, group_after_work=None, exclude_transit_message=True, summary_method='last_msg')
Bases: Pattern
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.
PARAMETER | DESCRIPTION |
---|---|
initial_agent | The first agent to speak in the group chat. TYPE: |
agents | List of all agents participating in the chat. TYPE: |
user_agent | Optional user proxy agent. TYPE: |
group_manager_args | Optional arguments for the GroupChatManager. |
context_variables | Initial context variables for the chat. TYPE: |
group_after_work | Default after work transition behavior when no specific next agent is determined. TYPE: |
exclude_transit_message | Whether to exclude transit messages from the conversation. TYPE: |
summary_method | Method for summarizing the conversation. TYPE: |
Source code in autogen/agentchat/group/patterns/pattern.py
group_after_work instance-attribute
#
group_after_work = group_after_work if group_after_work is not None else TerminateTarget()
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.
PARAMETER | DESCRIPTION |
---|---|
max_rounds | Maximum number of conversation rounds. TYPE: |
messages | Initial message(s) to start the conversation. |
RETURNS | DESCRIPTION |
---|---|
Tuple[list[ConversableAgent], list[ConversableAgent], Optional[ConversableAgent], ContextVariables, ConversableAgent, TransitionTarget, GroupToolExecutor, GroupChat, GroupChatManager, list[dict[str, Any]], Any, list[str], list[Any]] | Tuple containing all necessary components for the group chat. |
Source code in autogen/agentchat/group/patterns/pattern.py
create_default classmethod
#
create_default(initial_agent, agents, user_agent=None, group_manager_args=None, context_variables=None, exclude_transit_message=True, summary_method='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.
PARAMETER | DESCRIPTION |
---|---|
initial_agent | The first agent to speak in the group chat. TYPE: |
agents | List of all agents participating in the chat. TYPE: |
user_agent | Optional user proxy agent. TYPE: |
group_manager_args | Optional arguments for the GroupChatManager. |
context_variables | Initial context variables for the chat. TYPE: |
exclude_transit_message | Whether to exclude transit messages from the conversation. TYPE: |
summary_method | Method for summarizing the conversation. TYPE: |
RETURNS | DESCRIPTION |
---|---|
DefaultPattern | A DefaultPattern instance with basic configuration. |