mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-10 11:07:06 +00:00
[improvement][headless-chat]Prompt the LLM to create more readable alias.
This commit is contained in:
@@ -35,9 +35,9 @@ public class OnePassSCSqlGenStrategy extends SqlGenStrategy {
|
||||
+ "\n4.DO NOT calculate date range using functions."
|
||||
+ "\n5.DO NOT miss the AGGREGATE operator of metrics, always add it as needed."
|
||||
+ "\n6.ALWAYS use `with` statement if nested aggregation is needed."
|
||||
+ "\n7.ALWAYS add prefix `as_` to any alias created by the `AS` command."
|
||||
+ "\n#Exemplars:\n{{exemplar}}"
|
||||
+ "\n#Question:\nQuestion:{{question}},Schema:{{schema}},SideInfo:{{information}}";
|
||||
+ "\n7.ALWAYS enclose alias created by `AS` command in underscores and translate to the same language as the `Question`."
|
||||
+ "\n#Exemplars: {{exemplar}}"
|
||||
+ "\n#Question: Question:{{question}},Schema:{{schema}},SideInfo:{{information}}";
|
||||
|
||||
@Data
|
||||
static class SemanticSql {
|
||||
@@ -94,7 +94,7 @@ public class OnePassSCSqlGenStrategy extends SqlGenStrategy {
|
||||
private Prompt generatePrompt(LLMReq llmReq, LLMResp llmResp) {
|
||||
StringBuilder exemplars = new StringBuilder();
|
||||
for (Text2SQLExemplar exemplar : llmReq.getDynamicExemplars()) {
|
||||
String exemplarStr = String.format("Question:%s,Schema:%s,SideInfo:%s,SQL:%s\n",
|
||||
String exemplarStr = String.format("\nQuestion:%s,Schema:%s,SideInfo:%s,SQL:%s",
|
||||
exemplar.getQuestion(), exemplar.getDbSchema(), exemplar.getSideInfo(),
|
||||
exemplar.getSql());
|
||||
exemplars.append(exemplarStr);
|
||||
|
||||
Reference in New Issue
Block a user