(improvement)(chat) fix agentCanSupport null execption (#315)

This commit is contained in:
mainmain
2023-11-02 21:51:59 +08:00
committed by GitHub
parent 2f812372d7
commit 9cd3e22721

View File

@@ -40,7 +40,8 @@ public class AgentCheckParser implements SemanticParser {
queries.stream().map(SemanticQuery::getQueryMode).collect(Collectors.toList()));
queries.removeIf(query -> {
for (RuleQueryTool tool : queryTools) {
if (!tool.getQueryModes().contains(query.getQueryMode())) {
if (CollectionUtils.isNotEmpty(tool.getQueryModes())
&& !tool.getQueryModes().contains(query.getQueryMode())) {
return true;
}
if (CollectionUtils.isEmpty(tool.getModelIds())) {