(improvement)(Chat) Determine whether to enable LLM based on agent information (#810)

Co-authored-by: jolunoluo
This commit is contained in:
LXW
2024-03-13 10:22:16 +08:00
committed by GitHub
parent 46910fbfcf
commit 8a8370164f
4 changed files with 9 additions and 11 deletions

View File

@@ -66,6 +66,10 @@ public class Agent extends RecordInfo {
.collect(Collectors.toList());
}
public boolean containsLLMParserTool() {
return !CollectionUtils.isEmpty(getParserTools(AgentToolType.NL2SQL_LLM));
}
public Set<Long> getDataSetIds() {
Set<Long> dataSetIds = getDataSetIds(null);
if (containsAllModel(dataSetIds)) {

View File

@@ -106,6 +106,9 @@ public class ChatServiceImpl implements ChatService {
if (agent == null) {
return queryReq;
}
if (agent.containsLLMParserTool()) {
queryReq.setEnableLLM(true);
}
queryReq.setDataSetIds(agent.getDataSetIds());
return queryReq;
}