> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ag2.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# autogen.agentchat.group.patterns.DefaultPattern

<h2 id="autogen.agentchat.group.patterns.DefaultPattern" class="doc doc-heading">
  <code class="doc-symbol doc-symbol-heading doc-symbol-class" />

  <span class="doc doc-object-name doc-class-name">DefaultPattern</span>
</h2>

```python theme={null}
DefaultPattern(
    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'
)
```

DefaultPattern implements a minimal pattern for simple agent interactions.<br />This replaces the previous BasePattern and provides a concrete implementation
of the Pattern abstract base class.<br />Initialize the pattern with the required components.<br />

<b>Parameters:</b>

| Name                      | Description                                                                                                                                               |
| ------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `initial_agent`           | **Type:** ConversableAgent                                                                                                                                |
| `agents`                  | **Type:** list\['ConversableAgent']                                                                                                                       |
| `user_agent`              | **Type:** ForwardRef('ConversableAgent') \| None<br /><br />**Default:** None                                                                             |
| `group_manager_args`      | **Type:** dict\[str, typing.Any] \| None<br /><br />**Default:** None                                                                                     |
| `context_variables`       | **Type:** [ContextVariables](/docs/api-reference/autogen/agentchat/group/context_variables/ContextVariables) \| None<br /><br />**Default:** None         |
| `group_after_work`        | **Type:** [TransitionTarget](/docs/api-reference/autogen/agentchat/group/targets/transition_target/TransitionTarget) \| None<br /><br />**Default:** None |
| `exclude_transit_message` | **Type:** bool<br /><br />**Default:** True                                                                                                               |
| `summary_method`          | **Type:** str \| Callable\[..., Any] \| None<br /><br />**Default:** 'last\_msg'                                                                          |

### Static Methods

<code class="doc-symbol doc-symbol-heading doc-symbol-method" />

#### create\_default

```python theme={null}
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.<br />This replaces the need for a separate BasePattern class by providing
a factory method that creates a simple DefaultPattern instance.<br />

<b>Parameters:</b>

| Name                      | Description                                                                                                                                                                                          |
| ------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `initial_agent`           | The first agent to speak in the group chat.<br /><br />**Type:** ConversableAgent                                                                                                                    |
| `agents`                  | List of all agents participating in the chat.<br /><br />**Type:** list\['ConversableAgent']                                                                                                         |
| `user_agent`              | Optional user proxy agent.<br /><br />**Type:** ForwardRef('ConversableAgent') \| None<br /><br />**Default:** None                                                                                  |
| `group_manager_args`      | Optional arguments for the GroupChatManager.<br /><br />**Type:** dict\[str, typing.Any] \| None<br /><br />**Default:** None                                                                        |
| `context_variables`       | Initial context variables for the chat.<br /><br />**Type:** [ContextVariables](/docs/api-reference/autogen/agentchat/group/context_variables/ContextVariables) \| None<br /><br />**Default:** None |
| `exclude_transit_message` | Whether to exclude transit messages from the conversation.<br /><br />**Type:** bool<br /><br />**Default:** True                                                                                    |
| `summary_method`          | Method for summarizing the conversation.<br /><br />**Type:** str \| Callable\[..., Any] \| None<br /><br />**Default:** 'last\_msg'                                                                 |

<br />

### Instance Methods

<code class="doc-symbol doc-symbol-heading doc-symbol-method" />

#### prepare\_group\_chat

```python theme={null}
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 with default configuration.<br />This implementation calls the parent class method but ensures that
the group\_after\_work in the returned tuple is the pattern's own.<br />

<b>Parameters:</b>

| Name         | Description                                                                                             |
| ------------ | ------------------------------------------------------------------------------------------------------- |
| `max_rounds` | Maximum number of conversation rounds.<br /><br />**Type:** int                                         |
| `messages`   | Initial message(s) to start the conversation.<br /><br />**Type:** list\[dict\[str, typing.Any]] \| str |

<b>Returns:</b>

| Type                                                                                                                                                                                                                                                                                                                                                                                                                          | Description                                                   |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- |
| Tuple\[list\['ConversableAgent'], list\['ConversableAgent'], ConversableAgent \| None, [ContextVariables](/docs/api-reference/autogen/agentchat/group/context_variables/ContextVariables), ConversableAgent, [TransitionTarget](/docs/api-reference/autogen/agentchat/group/targets/transition_target/TransitionTarget), GroupToolExecutor, GroupChat, GroupChatManager, list\[dict\[str, Any]], Any, list\[str], list\[Any]] | Tuple containing all necessary components for the group chat. |

<br />
