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.
Requirements
Section titled “Requirements”Your admin must enable this feature and set up a Snowflake, Databricks, or BigQuery connection.
AI_CLASSIFY
Section titled “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 classifycategories- The list of categories to classify into. A minimum of two categories are required.
AI_CLASSIFY(text, category1, category2, ...)AI_CLASSIFY("I love this product!", "positive", "negative", "neutral")AI_COMPLETE
Section titled “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
AI_COMPLETE(prompt)AI_COMPLETE("Write a one-sentence summary of this quarter's revenue trends")AI_EXTRACT
Section titled “AI_EXTRACT”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 fromlabels- 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.
AI_EXTRACT(text, labels)AI_EXTRACT("John Smith lives in San Francisco and works for Snowflake", {"name": "What is the name?", "city": "What is the city?"})AI_SENTIMENT
Section titled “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
AI_SENTIMENT(text)AI_SENTIMENT("This product exceeded my expectations!")AI_SUMMARIZE
Section titled “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
AI_SUMMARIZE(text)AI_SUMMARIZE("JustAsk is a business intelligence platform that connects to your data warehouse...")