[improvement][headless-chat]Prioritize LLMSqlParser over RuleSqlParser.

This commit is contained in:
jerryjzhang
2024-09-27 16:21:46 +08:00
parent 764d3d24aa
commit a50fe98f00
6 changed files with 79 additions and 58 deletions

View File

@@ -16,6 +16,7 @@ import static com.tencent.supersonic.headless.chat.parser.ParserConfig.PARSER_TE
* by current candidate queries. If so, current parser could be skipped.
*/
@Slf4j
@Deprecated
public class SatisfactionChecker {
// check all the parse info in candidate

View File

@@ -8,7 +8,6 @@ import com.tencent.supersonic.headless.api.pojo.SchemaElementType;
import com.tencent.supersonic.headless.api.pojo.SemanticSchema;
import com.tencent.supersonic.headless.chat.ChatQueryContext;
import com.tencent.supersonic.headless.chat.parser.ParserConfig;
import com.tencent.supersonic.headless.chat.parser.SatisfactionChecker;
import com.tencent.supersonic.headless.chat.query.llm.s2sql.LLMReq;
import com.tencent.supersonic.headless.chat.query.llm.s2sql.LLMResp;
import com.tencent.supersonic.headless.chat.utils.ComponentFactory;
@@ -40,11 +39,6 @@ public class LLMRequestService {
return true;
}
if (SatisfactionChecker.isSkip(queryCtx)) {
log.info("skip {}, queryText:{}", LLMSqlParser.class, queryCtx.getQueryText());
return true;
}
return false;
}

View File

@@ -23,7 +23,8 @@ public class RuleSqlParser implements SemanticParser {
@Override
public void parse(ChatQueryContext chatQueryContext) {
if (!chatQueryContext.getText2SQLType().enableRule()) {
if (!chatQueryContext.getText2SQLType().enableRule()
|| !chatQueryContext.getCandidateQueries().isEmpty()) {
return;
}
SchemaMapInfo mapInfo = chatQueryContext.getMapInfo();