AI_SUMMARIZE

Summarize text per row via a registered chat model.

Category: aiReturns: STRINGDialect: DeltaForgeDeltaForge extension

Syntax

AI_SUMMARIZE(model_name, text)
AI_SUMMARIZE(text USE MODEL model_name)

Description

## Overview Task sugar over AI_GENERATE: sends the row text with a canned instruction ('summarize concisely, respond with only the summary') composed AFTER the model's SYSTEM_PROMPT, so a governed persona and the task both apply. Shares AI_GENERATE's batching, dedup, response memo, and error semantics. The USE MODEL sugar form is accepted and rewritten to the leading-model-argument form.

Parameters

NameTypeDescription
model_nameThe registry name of a MODEL_TYPE = CHAT model. Must be constant within a query.
textThe text to summarize. NULL produces NULL without calling the provider.

Examples

SELECT id, AI_SUMMARIZE('gpt5', article_body) AS abstract FROM news.silver.articles;
-- Materialize once instead of paying per query
CREATE TABLE news.gold.abstracts AS
SELECT id, AI_SUMMARIZE('gpt5', article_body) AS abstract FROM news.silver.articles;

Pitfalls

See Also

Open in interactive docs →   DeltaForge home →