Generates a concise summary of text using a Large Language Model (LLM).
Syntax
AI_SUMMARIZE([<resource_name>], <text>)Parameters
| Parameter | Description |
|---|---|
<resource_name> | The name of the AI resource to use. Optional. If omitted, the resource set by default_ai_resource is used. |
<text> | The text to summarize. |
Return value
A concise summary of the input text.
Returns
NULLif the input value isNULL.The result is generated by an LLM. The returned content may vary.
Examples
Example 1: Use the default AI resource
Set the default resource, then call AI_SUMMARIZE without specifying a resource name.
SET default_ai_resource = 'resource_name';
SELECT AI_SUMMARIZE('SelectDB is an MPP-based real-time data warehouse known for its high query speed.') AS Result;Output:
+-------------------------------------------------------------------+
| Result |
+-------------------------------------------------------------------+
| SelectDB is a high-speed, MPP-based real-time data warehouse. |
+-------------------------------------------------------------------+Example 2: Specify an AI resource
Pass the resource name as the first argument to override the default.
SELECT AI_SUMMARIZE('resourse_name','SelectDB supports high-concurrency, real-time analytics and is widely used in business intelligence scenarios.') AS Result;Output:
+--------------------------------------------------------------------------------------------------+
| Result |
+--------------------------------------------------------------------------------------------------+
| SelectDB is a high-concurrency, real-time analytics tool commonly used for business intelligence.|
+--------------------------------------------------------------------------------------------------+