跳到主要内容

LLM_FIXGRAMMAR

描述

用于修复文本中的语法错误

语法

LLM_FIXGRAMMAR([<resource_name>], <text>)

参数

参数说明
<resource_name>指定的资源名称,可空
<text>需要修复语法的文本

返回值

返回修复语法后的文本字符串

当输入有值为 NULL 时返回 NULL

结果为大模型生成,所以返回内容并不固定

示例

SET default_llm_resource = 'resource_name';
SELECT LLM_FIXGRAMMAR('Apache Doris a great system DB') AS Result;
+------------------------------------------+
| Result |
+------------------------------------------+
| Apache Doris is a great database system. |
+------------------------------------------+
SELECT LLM_FIXGRAMMAR('resource_name', 'I am like to using Doris') AS Result;
+--------------------+
| Result |
+--------------------+
| I like using Doris |
+--------------------+