AI_SUMMARIZE
functiondeferredAI & MLpreviewAI_SUMMARIZE is a managed Cortex AI function for summarizing text and multimodal content. It accepts either a TEXT input or a FILE reference to an image or document and returns a concise summary as TEXT. AI_SUMMARIZE automatically identifies key themes, facts, and relationships in the input, making it easy to summarize long-form text, images, and complex documents with a single function. The function supports multilingual content, although summary quality can vary by language.
Syntax
supportedpartialnot supportednot scored
For TEXT input
AI_SUMMARIZE( '<text>' [ , return_error_details => { TRUE | FALSE } ] )
For FILE input
AI_SUMMARIZE( TO_FILE( '<stage>' , '<file_path>' ) [ , return_error_details => { TRUE | FALSE } ] )
Parameters
| Name | Required | Description |
|---|---|---|
text | required | A string containing the text from which a summary should be generated. |
file | required | A FILE object representing the stage reference to the file from which a summary should be generated. |
return_error_details | optional | A boolean that reports row-level failures when set to TRUE. For more information, see BCR 2184. |
Returns
Returns a string summary of the input.
Usage notes
- Short inputs: AI_SUMMARIZE returns the original input when the input is 110 characters or fewer, and when a generated summary would be longer than the source. All tokens processed are billed.
- Summarizing across rows: Use AI_AGG rather than combining rows with LISTAGG before calling AI_SUMMARIZE.
- Regional differences: Supported modalities, context windows, file sizes, and page limits vary by region. See Limitations for details.
- Row-level errors: Use return_error_details => TRUE when you want error details for individual rows.
Limitations
Availability | Context Window – Text Inputs | Context Window – Files | Image Support | Document Support ANY_REGION | 272K | 1M | JPG/JPEG, PNG, WEBP, GIF · 100 MB | PDF, TXT, MD · 37.5 MB · 1,000 pagesTXT, MD, PDF, DOC/DOCX, XLS/XLSX, CSV, XHTML · 4.5 MB · 100 pages AWS_GLOBAL | 128K | 200K | JPG, PNG, WEBP, GIF · 3.75 MB | TXT, MD, PDF, DOC/DOCX, XLS/XLSX, CSV, XHTML · 4.5 MB · 100 pages AZURE_GLOBAL | 272K | 400K | JPG/JPEG, PNG, GIF, WEBP · 10 MB | N/A GCP_GLOBAL | 1M | 1M | JPG/JPEG, PNG, WEBP, GIF · 100 MB | PDF, TXT, MD · 37.5 MB · 1,000 pages
Legal
The data classification of inputs and outputs are as set forth in the following table. Input data classification | Output data classification | Designation Usage Data | Customer Data | Generally available functions are Covered AI Features. Preview functions are Preview AI Features. [1] [1] Represents the defined term used in the AI Terms and Acceptable Use Policy. For additional information, refer to Snowflake AI and ML.
Known gaps
- The emulator does not run language, embedding, document or speech models, so Cortex AI functions have no model to answer with.