> ## 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, Databricks, and BigQuery.

<Note>
  This feature is currently in beta and only supported for Snowflake, Databricks, and BigQuery databases.
</Note>

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.

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

## Requirements

To follow the steps in this guide, you'll need:

* **To have this feature enabled in your Omni organization.** Reach out to Omni support for assistance.
* **An existing Snowflake, Databricks, or BigQuery connection in Omni.** See the [Connecting data guides](/connect-data/setup) for setup instructions if you don't already have a connection.
* **If using BigQuery**, you'll also need to complete the following for the BigQuery project:
  1. **Enable the Vertex AI API (`aiplatform.googleapis.com`)**. You can enable it through the [Google Cloud Console](https://console.cloud.google.com/apis/library/aiplatform.googleapis.com) or using the `gcloud` CLI:

     ```bash wrap theme={null}
     gcloud services enable aiplatform.googleapis.com --project=<PROJECT_ID>
     ```

     Replace `<PROJECT_ID>` with the ID of your GCP project.
  2. **Add the Vertex AI user role (`roles/aiplatform.user`)**. Grant the role to:

     * The connection's service account, for service account and workload identity connections
     * Each user's Google account, for per-user OAuth connections

     For example, a project owner or IAM admin can run:

     ```bash title="Grant the Vertex AI User role" theme={null}
     gcloud projects add-iam-policy-binding PROJECT_ID \
       --member="serviceAccount:SERVICE_ACCOUNT_EMAIL" \
       --role="roles/aiplatform.user"
     ```

     If this role isn't granted, Omni's error message names the principal, role, and project to grant. Vertex AI usage is billed to your GCP project.

## AI\_CLASSIFY

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

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" wrap theme={null}
AI_CLASSIFY(text, category1, category2, ...)
```

```text title="Example" wrap 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, `ai_gen` in Databricks, and `AI.GENERATE(...).result` in BigQuery.

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" wrap theme={null}
AI_COMPLETE("Write a one-sentence summary of this quarter's revenue trends")
```

## AI\_EXTRACT

<Note>
  This function is not currently available for Snowflake.
</Note>

Extracts structured data from text based on specified labels. Equivalent to `ai_extract` in Databricks and `AI.GENERATE(...).result` in BigQuery.

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. In BigQuery, `AI_EXTRACT` is a prompt-based `AI.GENERATE` call, so it returns free text rather than the structured JSON object that Databricks returns.

```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, `ai_analyze_sentiment` in Databricks, and `AI.CLASSIFY` in BigQuery.

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, `ai_summarize` in Databricks, and `AI.GENERATE(...).result` in BigQuery.

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


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