LLM_GENERATE
Descriptionβ
Generates a response based on the input prompt text.
Syntaxβ
LLM_GENERATE([<resource_name>], <prompt>)
Parametersβ
Parameter | Description |
---|---|
<resource_name> | The specified resource name, optional |
<prompt> | The prompt text used to guide the LLM generation |
Return Valueβ
Returns the text content generated based on the prompt.
If any input is NULL, returns NULL.
The result is generated by a large language model, so the output may vary.
Examplesβ
SET default_llm_resource = 'resource_name';
SELECT LLM_GENERATE('Describe Apache Doris in a few words') AS Result;
+---------------------------------------------------------+
| Result |
+---------------------------------------------------------+
| "Apache Doris is a fast, real-time analytics database." |
+---------------------------------------------------------+
SELECT LLM_GENERATE('resource_name', 'What is the founding time of Apache Doris? Return only the date.') AS Result;
+--------+
| Result |
+--------+
| 2017 |
+--------+