Skip to main content
This feature is currently in beta and only supported for Snowflake and Databricks databases. Reach out to Omni support to have this feature enabled.
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.
Syntax
AI_CLASSIFY(text, category1, category2, ...)
Example
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
Syntax
AI_COMPLETE(prompt)
Example
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.
Syntax
AI_EXTRACT(text, labels)
Example
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
Syntax
AI_SENTIMENT(text)
Example
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
Syntax
AI_SUMMARIZE(text)
Example
AI_SUMMARIZE("Omni is a business intelligence platform that connects to your data warehouse...")