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

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

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

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

Complex expression-based context 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" />

#### evaluate

```python theme={null}
evaluate(self, context_variables: ContextVariables) -> bool
```

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

<b>Parameters:</b>

| Name                | Description                                                                                                                                                       |
| ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `context_variables` | The context variables to evaluate against<br /><br />**Type:** [ContextVariables](/docs/api-reference/autogen/agentchat/group/context_variables/ContextVariables) |

<b>Returns:</b>

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

<br />
