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

# ai_sentiment

> Analyzes the overall sentiment of text.

Analyzes the overall sentiment of text.

## Syntax

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

## Arguments

* `input`: A VARCHAR expression containing the text to analyze.

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 VARCHAR. Valid results are normalized to one of `positive`, `negative`, `neutral`, `mixed`, or `unknown`. Other responses are treated as row-level errors.

## Examples

```sql theme={null}
SELECT ai_sentiment('The delivery was excellent.');

SELECT ai_sentiment(input => 'The delivery was excellent.', provider => 'support_chat');
```


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