> ## 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.contrib.capabilities.transforms_util.should_transform_message

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

#### should\_transform\_message

```python theme={null}
should_transform_message(
    message: dict[str, Any],
    filter_dict: dict[str, Any] | None,
    exclude: bool
) -> bool
```

Validates whether the transform should be applied according to the filter dictionary.<br />

<b>Parameters:</b>

| Name          | Description                                                                                                                                         |
| ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| `message`     | The message to validate.<br /><br />**Type:** dict\[str, typing.Any]                                                                                |
| `filter_dict` | The filter dictionary to validate against.<br /><br />If None, the transform is always applied.<br /><br />**Type:** dict\[str, typing.Any] \| None |
| `exclude`     | Whether to exclude messages that match the filter dictionary.<br /><br />**Type:** bool                                                             |

<br />
