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

# ai_sentiment

> 分析文本的整体情感倾向。

分析文本的整体情感倾向。

## 语法

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

## 参数

* `input`：VARCHAR 表达式，要分析的文本。

`provider`、`model` 的类型及默认行为见 [公共调用规则](/documents/cn/4.2/sql-reference/sql-functions/ai-functions/ai_functions.md#公共调用规则)。

## 返回值

返回可空的 VARCHAR。有效结果归一化为 `positive`、`negative`、`neutral`、`mixed` 或 `unknown` 之一；其他响应按行级错误处理。

## 示例

```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.