[improvement][headless-chat]Prompt the LLM to add a fixed prefix to all aliases created by the AS command.

This commit is contained in:
jerryjzhang
2024-10-09 09:16:14 +08:00
parent 0f2b0e7986
commit 0654a54c8d
2 changed files with 3 additions and 2 deletions

View File

@@ -36,6 +36,7 @@ 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}}";

View File

@@ -83,10 +83,10 @@ public class Text2SQLEval extends BaseTest {
@Test
public void test_filter_and_top() throws Exception {
long start = System.currentTimeMillis();
QueryResult result = submitNewChat("近半个月来sales部门访问量最高的用户是谁", agentId);
QueryResult result = submitNewChat("近半个月来marketing部门访问量最高的用户是谁", agentId);
durations.add(System.currentTimeMillis() - start);
assert result.getQueryResults().size() == 1;
assert result.getTextResult().contains("tom");
assert result.getTextResult().contains("dean");
}
@Test