Skip to content

Commit 482ccf3

Browse files
committed
[improvement][headless-chat]Optimize text2sql prompt.
1 parent c697f0d commit 482ccf3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

headless/chat/src/main/java/com/tencent/supersonic/headless/chat/parser/llm/OnePassSCSqlGenStrategy.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public class OnePassSCSqlGenStrategy extends SqlGenStrategy {
4646
+ "\n8.ALWAYS enclose alias created by `AS` command in underscores."
4747
+ "\n9.ALWAYS translate alias created by `AS` command to the same language as the `#Question`."
4848
+ "\n#Exemplars: {{exemplar}}"
49-
+ "\n#Question: Question:{{question}},Schema:{{schema}},SideInfo:{{information}}";
49+
+ "\n#Query: Question:{{question}},Schema:{{schema}},SideInfo:{{information}}";
5050

5151
public OnePassSCSqlGenStrategy() {
5252
ChatAppManager.register(APP_KEY, ChatApp.builder().prompt(INSTRUCTION).name("语义SQL解析")
@@ -92,7 +92,8 @@ public LLMResp generate(LLMReq llmReq) {
9292
prompt2Exemplar.keySet().parallelStream().forEach(prompt -> {
9393
SemanticSql s2Sql = extractor.generateSemanticSql(prompt.toUserMessage().singleText());
9494
output2Prompt.put(s2Sql.getSql(), prompt);
95-
keyPipelineLog.info("OnePassSCSqlGenStrategy modelReq:\n{} \nmodelResp:\n{}", prompt.text(), s2Sql);
95+
keyPipelineLog.info("OnePassSCSqlGenStrategy modelReq:\n{} \nmodelResp:\n{}",
96+
prompt.text(), s2Sql);
9697
});
9798

9899
// 4.format response.

0 commit comments

Comments
 (0)