> ## 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.targets.transition_target.RandomAgentTarget

<h2 id="autogen.agentchat.group.targets.transition_target.RandomAgentTarget" class="doc doc-heading">
  <code class="doc-symbol doc-symbol-heading doc-symbol-class" />

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

```python theme={null}
RandomAgentTarget(agents: list['ConversableAgent'], **data: Any)
```

Target that represents a random selection from a list of agents.<br />Create a new model by parsing and validating input data from keyword arguments.<br />Raises \[`ValidationError`]\[pydantic\_core.ValidationError] if the input data cannot be
validated to form a valid model.<br />`self` is explicitly positional-only to allow `self` as a field name.

<b>Parameters:</b>

| Name     | Description                         |
| -------- | ----------------------------------- |
| `agents` | **Type:** list\['ConversableAgent'] |
| `**data` | **Type:** Any                       |

### Class Attributes

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

#### agent\_names

<br />

<br />

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

#### model\_config

<br />

<br />

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

#### nominated\_name

<br />

<br />

### Instance Methods

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

#### can\_resolve\_for\_speaker\_selection

```python theme={null}
can_resolve_for_speaker_selection(self) -> bool
```

Check if the target can resolve for speaker selection.

<br />

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

#### create\_wrapper\_agent

```python theme={null}
create_wrapper_agent(
    self,
    parent_agent: ConversableAgent,
    index: int
) -> ConversableAgent
```

Create a wrapper agent for the target if needed.

<b>Parameters:</b>

| Name           | Description                |
| -------------- | -------------------------- |
| `parent_agent` | **Type:** ConversableAgent |
| `index`        | **Type:** int              |

<br />

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

#### display\_name

```python theme={null}
display_name(self) -> str
```

Get the display name for the target.

<br />

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

#### needs\_agent\_wrapper

```python theme={null}
needs_agent_wrapper(self) -> bool
```

Check if the target needs to be wrapped in an agent.

<br />

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

#### normalized\_name

```python theme={null}
normalized_name(self) -> str
```

Get a normalized name for the target that has no spaces, used for function calling

<br />

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

#### resolve

```python theme={null}
resolve(
    self,
    groupchat: GroupChat,
    current_agent: ConversableAgent,
    user_agent: ForwardRef('ConversableAgent') | None
) -> SpeakerSelectionResult
```

Resolve to the actual agent object from the groupchat, choosing a random agent (except the current one)

<b>Parameters:</b>

| Name            | Description                                      |
| --------------- | ------------------------------------------------ |
| `groupchat`     | **Type:** GroupChat                              |
| `current_agent` | **Type:** ConversableAgent                       |
| `user_agent`    | **Type:** ForwardRef('ConversableAgent') \| None |

<br />
