mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-11 03:58:14 +00:00
(improvement)(Chat) Determine whether to enable LLM based on agent information (#810)
Co-authored-by: jolunoluo
This commit is contained in:
@@ -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)) {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user