に最終更新
AI_GENERATE
説明
入力したプロンプトのテキストに基づいて応答を生成します。
構文
AI_GENERATE([<resource_name>], <prompt>)
引数
| 引数 | 説明 |
|---|---|
<resource_name> | 指定するリソース名。省略可能 |
<prompt> | AI による生成を指示するプロンプトのテキスト |
戻り値
プロンプトに基づいて生成されたテキストを返します。
いずれかの入力が NULL の場合は NULL を返します。
結果は大規模言語モデルによって生成されるため、出力は変わることがあります。
例
SET default_ai_resource = 'resource_name';
SELECT AI_GENERATE('Describe Apache Doris in a few words') AS Result;
+---------------------------------------------------------+
| Result |
+---------------------------------------------------------+
| "Apache Doris is a fast, real-time analytics database." |
+---------------------------------------------------------+
SELECT AI_GENERATE('resource_name', 'What is the founding time of Apache Doris? Return only the date.') AS Result;
+--------+
| Result |
+--------+
| 2017 |
+--------+