Refine SQL output formatting in prompts to enforce pure text SQL without Markdown code fences. Allow inline comments using -- and update few-shot selector to reflect these changes in output presentation. Enhance clarity on SQL output requirements for better adherence to standards.

This commit is contained in:
陈辅元
2026-04-16 16:40:22 +08:00
parent f492e29749
commit 4ee0ad2eec
4 changed files with 8 additions and 6 deletions
+3 -1
View File
@@ -491,7 +491,9 @@ class FewShotSelector:
lines.append(f"## {ex.qid}. {ex.question_zh[:50]}")
lines.append(f"评分: {ex.rating}/10")
lines.append(f"标签: {', '.join(ex.tags)}")
lines.append(f"```sql\n{ex.sql}\n```\n")
lines.append("SQL(纯文本,允许 -- 注释;禁止 ``` 围栏):")
lines.append(ex.sql)
lines.append("")
return "\n".join(lines)