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

# ai_filter

> Determines whether text meets a condition expressed in natural language.

Determines whether text meets a condition expressed in natural language.

## Syntax

```sql theme={null}
ai_filter(input, condition[, provider[, model]])
```

## Arguments

* `input`: A VARCHAR expression containing the text to evaluate.
* `condition`: A VARCHAR expression describing the condition in natural language.

For the types and default behavior of `provider` and `model`, see [Common calling rules](/documents/4.2/sql-reference/sql-functions/ai-functions/ai_functions.md#common-calling-rules).

## Return value

Returns a nullable BOOLEAN. The model response must normalize to `true` or `false`. Other responses are treated as row-level errors.

## Examples

```sql theme={null}
SELECT ai_filter('The package arrived broken.', 'The customer reports damaged goods.');

SELECT ai_filter(
    input => 'The package arrived broken.',
    condition => 'The customer reports damaged goods.',
    provider => 'support_chat'
);
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.