Source
Snowflake Cortex AISQL (including LLM functions)
Use Cortex AISQL in Snowflake to run unstructured analytics on text and images with industry - leading LLMs from OpenAI, Anthropic, Meta, Mistral AI, and DeepSeek.
AI_COMPLETE
Generates a response (completion) from text or an image using a supported language model. You can provide: A text prompt, to generate a response from the model.
AI_COUNT_TOKENS
AI_COUNT_TOKENS is the updated version of COUNT_TOKENS (SNOWFLAKE.CORTEX). For the latest functionality, use AI_COUNT_TOKENS. Returns the number of tokens in a prompt for the specified large language model or task - specific function.
AI_EXTRACT
Preview Feature — Open Available to all accounts. Extracts information from an input string or file.
AI_COMPLETE (Single string)
Generates a response (completion) for a text prompt using a supported language model. Syntax The function contains two required arguments and four optional arguments. The function can be used with either positional or named argument…
AI_CLASSIFY
AI_CLASSIFY is the updated version of CLASSIFY_TEXT (SNOWFLAKE.CORTEX). For the latest functionality, use AI_CLASSIFY. Classifies text or images into categories that you specify.
AI_COMPLETE structured outputs
AI_COMPLETE lets you supply a JSON schema or type literal that completion responses must follow, producing structured output. Structured output reduces the need for post - processing in your AI data pipelines and enables seamless integration…
AI_COMPLETE (Single image)
Generates a response (completion) for a text prompt using a supported language model. Syntax The function has two required arguments and four optional arguments. The function can be used with either positional or named argument syntax.
AI_AGG
Reduces a column of text data using a natural language instruction. For example, AI_AGG(reviews, 'Describe the most common complaints mentioned in the book reviews') will return a summary of user feedback.
AI_COMPLETE (Prompt object)
Generates a response (completion) for a prompt object. The prompt object references one or more columns containing text or image data. Syntax The function can be used with either positional or named argument syntax.