[improvement][chat]Introduce AllFieldMapper to increase parsing robustness when normal pipeline fails.

[improvement][chat]Introduce `AllFieldMapper` to increase parsing robustness when normal pipeline fails.
This commit is contained in:
jerryjzhang
2024-12-26 21:33:40 +08:00
parent a4d2df4063
commit 94267f6028
19 changed files with 156 additions and 33 deletions

View File

@@ -4,8 +4,9 @@ com.tencent.supersonic.headless.chat.mapper.SchemaMapper=\
com.tencent.supersonic.headless.chat.mapper.EmbeddingMapper, \
com.tencent.supersonic.headless.chat.mapper.KeywordMapper, \
com.tencent.supersonic.headless.chat.mapper.QueryFilterMapper, \
com.tencent.supersonic.headless.chat.mapper.TimeFieldMapper,\
com.tencent.supersonic.headless.chat.mapper.TermDescMapper
com.tencent.supersonic.headless.chat.mapper.PartitionTimeMapper,\
com.tencent.supersonic.headless.chat.mapper.TermDescMapper,\
com.tencent.supersonic.headless.chat.mapper.AllFieldMapper
com.tencent.supersonic.headless.chat.parser.SemanticParser=\
com.tencent.supersonic.headless.chat.parser.llm.LLMSqlParser,\

View File

@@ -24,6 +24,7 @@ import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInstance;
import org.junitpioneer.jupiter.SetSystemProperty;
import org.springframework.test.context.TestPropertySource;
import java.util.List;
@@ -95,6 +96,7 @@ public class Text2SQLEval extends BaseTest {
}
@Test
@SetSystemProperty(key = "s2.test", value = "true")
public void test_drilldown_and_topN() throws Exception {
long start = System.currentTimeMillis();
QueryResult result = submitNewChat("过去30天访问次数最高的部门top3", agent.getId());

View File

@@ -7,6 +7,7 @@ import com.tencent.supersonic.headless.api.pojo.response.SemanticQueryResp;
import com.tencent.supersonic.util.DataUtils;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.junitpioneer.jupiter.SetSystemProperty;
import static java.time.LocalDate.now;
import static org.junit.Assert.assertEquals;
@@ -29,6 +30,7 @@ public class QueryBySqlTest extends BaseTest {
}
@Test
@SetSystemProperty(key = "s2.test", value = "true")
public void testSumQuery() throws Exception {
SemanticQueryResp semanticQueryResp =
queryBySql("SELECT SUM(访问次数) AS 总访问次数 FROM 超音数PVUV统计 ");