Skip to main content
This feature is currently in beta and only supported for Snowflake, Databricks, and BigQuery databases.
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 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 or using the gcloud CLI:
      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:
      Grant the Vertex AI User role
      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.
Syntax
Example

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
Syntax
Example

AI_EXTRACT

This function is not currently available for Snowflake.
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.
Syntax
Example

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
Syntax
Example

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
Syntax
Example