Skip to content

Supported AI functions

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

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

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

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

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?"})

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!")

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("JustAsk is a business intelligence platform that connects to your data warehouse...")