[improvement][headless-chat]Prompt LLM to generate with SQL statement to handle secondary calculation scenario.#1718

This commit is contained in:
jerryjzhang
2024-10-08 16:05:43 +08:00
parent 8bf5d395a7
commit 27e654a873
6 changed files with 37 additions and 48 deletions

View File

@@ -34,9 +34,8 @@ public class OnePassSCSqlGenStrategy extends SqlGenStrategy {
+ "\n2.ALWAYS specify date filter using `>`,`<`,`>=`,`<=` operator."
+ "\n3.DO NOT include date filter in the where clause if not explicitly expressed in the `Question`."
+ "\n4.DO NOT calculate date range using functions."
+ "\n5.DO NOT calculate date range using DATE_SUB."
+ "\n6.DO NOT miss the AGGREGATE operator of metrics, always add it as needed."
+ "\n7.ALWAYS USE `with` statement to handle secondary calculation scenario.\""
+ "\n5.DO NOT miss the AGGREGATE operator of metrics, always add it as needed."
+ "\n6.ALWAYS use `with` statement if nested aggregation is needed."
+ "\n#Exemplars:\n{{exemplar}}"
+ "\n#Question:\nQuestion:{{question}},Schema:{{schema}},SideInfo:{{information}}";