(fix)(headless) 修复LLM问题变成术语的问题 (#1617)

Co-authored-by: wangyudong
This commit is contained in:
yudong
2024-09-02 21:41:19 +08:00
committed by GitHub
parent 26863769b5
commit 14177e265f
2 changed files with 6 additions and 0 deletions

View File

@@ -23,11 +23,15 @@ public class TermDescMapper extends BaseMapper {
chatQueryContext.setOriQueryText(chatQueryContext.getQueryText());
}
for (SchemaElement schemaElement : termDescriptionToMap) {
if (schemaElement.isDescriptionMapped()) {
continue;
}
if (chatQueryContext.getQueryText().equals(schemaElement.getDescription())) {
schemaElement.setDescriptionMapped(true);
continue;
}
chatQueryContext.setQueryText(schemaElement.getDescription());
break;
}
if (CollectionUtils.isEmpty(chatQueryContext.getMapInfo().getTermDescriptionToMap())) {
chatQueryContext.setQueryText(chatQueryContext.getOriQueryText());

View File

@@ -47,6 +47,8 @@ public class ChatWorkflowEngine {
parseResult.setState(ParseResp.ParseState.FAILED);
parseResult.setErrorMsg("No semantic entities can be mapped against user question.");
queryCtx.setChatWorkflowState(ChatWorkflowState.FINISHED);
} else if (queryCtx.getMapInfo().needContinueMap()) {
queryCtx.setChatWorkflowState(ChatWorkflowState.MAPPING);
} else {
queryCtx.setChatWorkflowState(ChatWorkflowState.PARSING);
}