mirror of
https://github.com/tencentmusic/supersonic.git
synced 2026-04-29 20:44:25 +08:00
[improvement][chat]Introduce AppModule to classify chat apps.
This commit is contained in:
@@ -8,6 +8,7 @@ import com.tencent.supersonic.chat.server.agent.AgentToolType;
|
||||
import com.tencent.supersonic.chat.server.agent.DatasetTool;
|
||||
import com.tencent.supersonic.chat.server.agent.ToolConfig;
|
||||
import com.tencent.supersonic.common.pojo.ChatApp;
|
||||
import com.tencent.supersonic.common.pojo.enums.AppModule;
|
||||
import com.tencent.supersonic.common.pojo.enums.StatusEnum;
|
||||
import com.tencent.supersonic.common.pojo.enums.TypeEnums;
|
||||
import com.tencent.supersonic.common.util.ChatAppManager;
|
||||
@@ -182,7 +183,8 @@ public class S2ArtistDemo extends S2BaseDemo {
|
||||
agent.setToolConfig(JSONObject.toJSONString(toolConfig));
|
||||
|
||||
// configure chat apps
|
||||
Map<String, ChatApp> chatAppConfig = Maps.newHashMap(ChatAppManager.getAllApps());
|
||||
Map<String, ChatApp> chatAppConfig =
|
||||
Maps.newHashMap(ChatAppManager.getAllApps(AppModule.CHAT));
|
||||
chatAppConfig.values().forEach(app -> app.setChatModelId(demoChatModel.getId()));
|
||||
agent.setChatAppConfig(chatAppConfig);
|
||||
agentService.createAgent(agent, defaultUser);
|
||||
|
||||
@@ -157,10 +157,11 @@ public class S2VisitsDemo extends S2BaseDemo {
|
||||
datasetTool.setType(AgentToolType.DATASET);
|
||||
datasetTool.setDataSetIds(Lists.newArrayList(dataSetId));
|
||||
toolConfig.getTools().add(datasetTool);
|
||||
|
||||
agent.setToolConfig(JSONObject.toJSONString(toolConfig));
|
||||
|
||||
// configure chat apps
|
||||
Map<String, ChatApp> chatAppConfig = Maps.newHashMap(ChatAppManager.getAllApps());
|
||||
Map<String, ChatApp> chatAppConfig =
|
||||
Maps.newHashMap(ChatAppManager.getAllApps(AppModule.CHAT));
|
||||
chatAppConfig.values().forEach(app -> app.setChatModelId(demoChatModel.getId()));
|
||||
agent.setChatAppConfig(chatAppConfig);
|
||||
Agent agentCreated = agentService.createAgent(agent, defaultUser);
|
||||
|
||||
Reference in New Issue
Block a user