[improvement][chat]Only return the parse info of the highest score for one dataset pass.#1847

This commit is contained in:
jerryjzhang
2024-10-28 20:00:34 +08:00
parent de4384062c
commit e046a55567
2 changed files with 8 additions and 4 deletions

View File

@@ -44,14 +44,11 @@ public class ChatQueryContext {
}
public List<SemanticQuery> getCandidateQueries() {
ParserConfig parserConfig = ContextUtils.getBean(ParserConfig.class);
int parseShowCount =
Integer.parseInt(parserConfig.getParameterValue(ParserConfig.PARSER_SHOW_COUNT));
candidateQueries = candidateQueries.stream()
.sorted(Comparator.comparing(
semanticQuery -> semanticQuery.getParseInfo().getScore(),
Comparator.reverseOrder()))
.limit(parseShowCount).collect(Collectors.toList());
.limit(1).collect(Collectors.toList());
return candidateQueries;
}