search_sql_template
Retrieve reusable SQL templates by keyword or natural language, filtered by document type, category, or verified status. Combines semantic and keyword search to return SQL snippets with verification status.
Instructions
在模板库中检索可复用的 SQL 模板(生成 SQL 前先调用,形成闭环)。
采用混合检索:语义向量召回(NVIDIA Embedding) + 关键词模糊匹配,按相似度/使用次数综合排序。 若未配置 NVIDIA_API_KEY,自动降级为纯关键词检索,不影响原有能力。
参数:
keyword: 关键词或自然语言描述(如「把询价单退回到报价中」「ssrc_rfx_header」)
doc_type: 按单据类型过滤(通用/询价单/招标单/征询单/数据修复)
category: 按业务分类过滤(通用基础查询/询价单RFX/征询单RF/数据修复)
verified_only: 仅返回「✅ 已验证」模板
limit: 返回条数上限
use_semantic: 是否启用语义召回(默认 true;无 NVIDIA key 时自动忽略)
返回:匹配模板的 Markdown 列表(含 SQL 与验证状态,语义命中会标注相似度)。
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| keyword | No | ||
| category | No | ||
| doc_type | No | ||
| use_semantic | No | ||
| verified_only | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |