- Categories:
String & binary functions (AI Functions)
COMPLETE (SNOWFLAKE.CORTEX) (multimodal)¶
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:
Arguments¶
modelA string specifying the model to be used. See supported models.
Supported models might have different costs and context windows.
promptA string containing a question about the image and optionally specifying an output format, such as JSON. Either this or the
prompt_objectargument is required.prompt_objectA SQL OBJECT containing a string prompt with numbered placeholders ({0}, {1}, and so on) and one or more text or FILE valuse 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
promptis required.file_objectA 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 tableAn 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¶
- Inputs exceeding the context window limit result in an error. Output which would exceed the context window limit is truncated.
- To process multiple images, the prompt must be an object (typically created using the PROMPT function) that specifies a prompt template and the files to be processed.
- Only text and images are supported. Video and audio files are not supported.
- Images with filename extensions
.jpg,.jpeg,.png,.gif, and.webpare supported.pixtral-largealso supports.bmp. - Maximum image size is 10 MB for
pixtral-largeand 3.75 MB forclaude-sonnet-4-6. Additionally,claude-sonnet-4-6does not support images with a resolution greater than 8000x8000. - The stage containing the images must have server-side encryption enabled. Client-side encrypted stages are not supported.
- The function does not support custom network policies.
- Stage names are not case-sensitive, but paths are.
Legal notices¶
Refer to Snowflake AI and ML.