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

# ai_fix_grammar

> Corrects grammar and spelling, asking the model to preserve the original meaning and tone.

Corrects grammar and spelling, asking the model to preserve the original meaning and tone.

## Syntax

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

## Arguments

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

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 containing the corrected text.

## Examples

```sql theme={null}
SELECT ai_fix_grammar('She go to school every day.');

SELECT ai_fix_grammar(input => 'She go to school every day.', provider => 'support_chat');
```


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