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.
AI_CLASSIFY
Section titled “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 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 and ai_gen in Databricks.
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. Not currently available for Snowflake.
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.
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 and ai_analyze_sentiment in Databricks.
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 and ai_summarize in Databricks.
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...")