mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-11 12:07:42 +00:00
[improvement][headless-chat]Prompt the LLM to add a fixed prefix to all aliases created by the AS command.
This commit is contained in:
@@ -36,6 +36,7 @@ public class OnePassSCSqlGenStrategy extends SqlGenStrategy {
|
|||||||
+ "\n4.DO NOT calculate date range using functions."
|
+ "\n4.DO NOT calculate date range using functions."
|
||||||
+ "\n5.DO NOT miss the AGGREGATE operator of metrics, always add it as needed."
|
+ "\n5.DO NOT miss the AGGREGATE operator of metrics, always add it as needed."
|
||||||
+ "\n6.ALWAYS use `with` statement if nested aggregation is 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#Exemplars:\n{{exemplar}}"
|
||||||
+ "\n#Question:\nQuestion:{{question}},Schema:{{schema}},SideInfo:{{information}}";
|
+ "\n#Question:\nQuestion:{{question}},Schema:{{schema}},SideInfo:{{information}}";
|
||||||
|
|
||||||
|
|||||||
@@ -83,10 +83,10 @@ public class Text2SQLEval extends BaseTest {
|
|||||||
@Test
|
@Test
|
||||||
public void test_filter_and_top() throws Exception {
|
public void test_filter_and_top() throws Exception {
|
||||||
long start = System.currentTimeMillis();
|
long start = System.currentTimeMillis();
|
||||||
QueryResult result = submitNewChat("近半个月来sales部门访问量最高的用户是谁", agentId);
|
QueryResult result = submitNewChat("近半个月来marketing部门访问量最高的用户是谁", agentId);
|
||||||
durations.add(System.currentTimeMillis() - start);
|
durations.add(System.currentTimeMillis() - start);
|
||||||
assert result.getQueryResults().size() == 1;
|
assert result.getQueryResults().size() == 1;
|
||||||
assert result.getTextResult().contains("tom");
|
assert result.getTextResult().contains("dean");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
Reference in New Issue
Block a user