COMPLETE

functiondeferredAI & ML

docs.snowflake.com ↗

String & binary functions

Notice This page is provided for backward compatibility. For new use cases, start with AI_COMPLETE, which is the canonical surface going forward. This legacy function will be deprecated by the end of 2026. Given an image and a prompt, generates a response (completion) using a language model. This function variant supports image models along with text models, and processes images stored in an internal Snowflake stage or an external stage. COMPLETE can be used to process a single image, multiple images in a batch fashion, applying the same or a different prompt to each image, or multiple images in a single operation (for example, comparison).

Syntax

Use one of the following

SNOWFLAKE.CORTEX.COMPLETE(
    '<model>', '<prompt>', <file_object>)
FROM <table>

Use one of the following

SNOWFLAKE.CORTEX.COMPLETE(
    '<model>', <prompt_object> )
FROM <table>

Parameters

NameRequiredDescription
modelrequiredA string specifying the model to be used. See supported models. Supported models might have different costs and context windows.
promptrequiredA string containing a question about the image and optionally specifying an output format, such as JSON. Either this or the prompt_object argument is required.
prompt_objectrequiredA SQL OBJECT containing a string prompt with numbered placeholders ({0}, {1}, and so on) and one or more text or FILE values that are inserted into the prompt. The PROMPT function is a convenient way to create an object with the required layout. Either this argument or prompt is required.
file_objectrequiredA FILE object that contains an image file to be processed. Use the TO_FILE function to create FILE objects from a stage path. Required when using a string prompt.
FROM tablerequiredAn optional table containing image paths and an optional prompt for each image, allowing images to be batch-processed in a single call to COMPLETE.

Returns

A string containing the language model’s response.

Usage notes

Legal notices

Refer to Snowflake AI and ML.

Known gaps

Parts not fully supported, and recorded divergences from Snowflake.