mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-12 12:37:55 +00:00
(improvement)(headless)Optimize prompts and exemplars
This commit is contained in:
@@ -65,9 +65,10 @@ public class OnePassSCSqlGenStrategy extends SqlGenStrategy {
|
||||
+ "please convert it to a SQL query so that relevant answer could be returned to the user "
|
||||
+ "by executing the SQL query against underlying database.\n"
|
||||
+ "#Rules:\n"
|
||||
+ "1.Always use `数据日期` as the date field.\n"
|
||||
+ "2.Always use `datediff` function to calculate date range.\n"
|
||||
+ "3.Only output SQL statement.\n"
|
||||
+ "1.ALWAYS use `数据日期` as the date field.\n"
|
||||
+ "2.ALWAYS use `datediff()` as the date function.\n"
|
||||
+ "3.DO NOT specify date filter in the where clause if not explicitly mentioned in the query.\n"
|
||||
+ "4.ONLY output SQL statement.\n"
|
||||
+ "#Exemplars:\n%s"
|
||||
+ "#UserQuery: %s "
|
||||
+ "#DatabaseMetadata: %s "
|
||||
|
||||
@@ -63,10 +63,10 @@ public class PromptHelper {
|
||||
String fieldValue = value.getFieldValue();
|
||||
priorLinkingList.add("‘" + fieldValue + "‘是一个‘" + fieldName + "‘");
|
||||
}
|
||||
String currentDataStr = "current date is " + currentDate;
|
||||
String currentDataStr = "当前的日期是" + currentDate;
|
||||
String linkingListStr = String.join(",", priorLinkingList);
|
||||
String termStr = getTermStr(llmReq);
|
||||
String questionAugmented = String.format("%s (补充信息:%s . %s . %s) (备注: %s)", llmReq.getQueryText(),
|
||||
String questionAugmented = String.format("%s (补充信息:%s;%s;%s;%s)", llmReq.getQueryText(),
|
||||
linkingListStr, currentDataStr, termStr, priorExts);
|
||||
|
||||
return Pair.of(dbSchema, questionAugmented);
|
||||
|
||||
Reference in New Issue
Block a user