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

# Supported AI functions

> Reference for AI-powered table calculation functions in Omni for text analysis and generation, using Snowflake and Databricks.

Omni supports AI functions for text analysis and generation, powered by your warehouse's native AI capabilities. This reference details the AI functions supported by Omni.

<Note>
  This feature is currently in beta and only supported for Snowflake and Databricks databases. Reach out to Omni support to have this feature enabled.
</Note>

AI functions are translated to native SQL functions in your warehouse.

## AI\_CLASSIFY

Classifies text into one of the provided categories. Equivalent to `SNOWFLAKE.CORTEX.CLASSIFY_TEXT` in Snowflake and  `ai_classify` in Databricks.

This function accepts two arguments:

* `text` - The text content to classify
* `categories` - The list of categories to classify into. A minimum of two categories are required.

```text title="Syntax" theme={null}
AI_CLASSIFY(text, category1, category2, ...)
```

```text title="Example" theme={null}
AI_CLASSIFY("I love this product!", "positive", "negative", "neutral")
```

## AI\_COMPLETE

Generates a text completion from a prompt. The model is selected automatically by the warehouse. Equivalent to `SNOWFLAKE.CORTEX.COMPLETE` in Snowflake and  `ai_gen` in Databricks.

This function accepts one argument:

* `prompt` - The text prompt to generate a completion for

```text title="Syntax" theme={null}
AI_COMPLETE(prompt)
```

```text title="Example" theme={null}
AI_COMPLETE("Write a one-sentence summary of this quarter's revenue trends")
```

## AI\_EXTRACT

Extracts structured data from text based on specified labels. Equivalent to `ai_extract` in Databricks. Not currently available for Snowflake.

This function accepts two arguments:

* `text` - The text content to extract data from
* `labels` - The labels or questions defining what information to extract

Returns a JSON object containing the extracted information.

```text title="Syntax" theme={null}
AI_EXTRACT(text, labels)
```

```text title="Example" wrap theme={null}
AI_EXTRACT("John Smith lives in San Francisco and works for Snowflake", {"name": "What is the name?", "city": "What is the city?"})
```

## AI\_SENTIMENT

Analyzes the sentiment of text, returning a score indicating positive, negative, or neutral sentiment. Equivalent to `SNOWFLAKE.CORTEX.SENTIMENT` in Snowflake and `ai_analyze_sentiment` in Databricks.

This function accepts one argument:

* `text` - The text content to analyze

```text title="Syntax" theme={null}
AI_SENTIMENT(text)
```

```text title="Example" theme={null}
AI_SENTIMENT("This product exceeded my expectations!")
```

## AI\_SUMMARIZE

Summarizes text content into a shorter form. Equivalent to `SNOWFLAKE.CORTEX.SUMMARIZE` in Snowflake and `ai_summarize` in Databricks.

This function accepts one argument:

* `text` - The text content to summarize

```text title="Syntax" theme={null}
AI_SUMMARIZE(text)
```

```text title="Example" theme={null}
AI_SUMMARIZE("Omni is a business intelligence platform that connects to your data warehouse...")
```
