> ## 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.ExpressionAvailableCondition

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

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

```python theme={null}
ExpressionAvailableCondition(expression: ContextExpression, **data: Any)
```

Expression-based available condition.<br />This condition evaluates a ContextExpression against the context variables.<br />Initialize with an expression as a positional parameter.<br />

<b>Parameters:</b>

| Name         | Description                                                                  |
| ------------ | ---------------------------------------------------------------------------- |
| `expression` | **Type:** [ContextExpression](/docs/api-reference/autogen/ContextExpression) |
| `**data`     | **Type:** Any                                                                |

### Class Attributes

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

#### expression

<br />

<br />

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

#### model\_config

<br />

<br />

### Instance Methods

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

#### is\_available

```python theme={null}
is_available(
    self,
    agent: ConversableAgent,
    messages: list[dict[str, Any]]
) -> bool
```

Evaluate the expression against the context variables.<br />

<b>Parameters:</b>

| Name       | Description                                                                            |
| ---------- | -------------------------------------------------------------------------------------- |
| `agent`    | The agent with context variables<br /><br />**Type:** ConversableAgent                 |
| `messages` | The conversation history (not used)<br /><br />**Type:** list\[dict\[str, typing.Any]] |

<b>Returns:</b>

| Type | Description                                 |
| ---- | ------------------------------------------- |
| bool | Boolean result of the expression evaluation |

<br />
