mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-12 04:27:39 +00:00
(improvement)(chat) add cspider demo (#262)
This commit is contained in:
@@ -150,8 +150,6 @@ public class QueryServiceImpl implements QueryService {
|
||||
.candidateParses(candidateParses)
|
||||
.build();
|
||||
chatParseDOS = chatService.batchAddParse(chatCtx, queryReq, parseResult, candidateParses, selectedParses);
|
||||
saveInfo(timeCostDOList, queryReq.getQueryText(), parseResult.getQueryId(),
|
||||
queryReq.getUser().getName(), queryReq.getChatId().longValue());
|
||||
} else {
|
||||
parseResult = ParseResp.builder()
|
||||
.chatId(queryReq.getChatId())
|
||||
@@ -166,7 +164,7 @@ public class QueryServiceImpl implements QueryService {
|
||||
.interfaceName(parseResponder.getClass().getSimpleName())
|
||||
.type(CostType.PARSERRESPONDER.getType()).build());
|
||||
}
|
||||
if (timeCostDOList.size() > 0) {
|
||||
if (Objects.nonNull(parseResult.getQueryId()) && timeCostDOList.size() > 0) {
|
||||
saveInfo(timeCostDOList, queryReq.getQueryText(), parseResult.getQueryId(),
|
||||
queryReq.getUser().getName(), queryReq.getChatId().longValue());
|
||||
}
|
||||
|
||||
@@ -265,6 +265,28 @@ public class ConfigureDemo implements ApplicationListener<ApplicationReadyEvent>
|
||||
agentService.createAgent(agent, User.getFakeUser());
|
||||
}
|
||||
|
||||
private void addAgent3() {
|
||||
Agent agent = new Agent();
|
||||
agent.setId(3);
|
||||
agent.setName("cspider");
|
||||
agent.setDescription("cspider数据集的case展示");
|
||||
agent.setStatus(1);
|
||||
agent.setEnableSearch(1);
|
||||
agent.setExamples(Lists.newArrayList("可用“mp4”格式且分辨率低于1000的歌曲的ID是什么?",
|
||||
"“孟加拉语”歌曲的平均评分和分辨率是多少?",
|
||||
"找出所有至少有一首“英文”歌曲的艺术家的名字和作品数量。"));
|
||||
AgentConfig agentConfig = new AgentConfig();
|
||||
|
||||
LLMParserTool llmParserTool = new LLMParserTool();
|
||||
llmParserTool.setId("1");
|
||||
llmParserTool.setType(AgentToolType.LLM_S2QL);
|
||||
llmParserTool.setModelIds(Lists.newArrayList(3L));
|
||||
agentConfig.getTools().add(llmParserTool);
|
||||
|
||||
agent.setAgentConfig(JSONObject.toJSONString(agentConfig));
|
||||
agentService.createAgent(agent, User.getFakeUser());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onApplicationEvent(ApplicationReadyEvent applicationReadyEvent) {
|
||||
if (!demoEnable) {
|
||||
@@ -276,6 +298,7 @@ public class ConfigureDemo implements ApplicationListener<ApplicationReadyEvent>
|
||||
addPlugin_1();
|
||||
addAgent1();
|
||||
addAgent2();
|
||||
addAgent3();
|
||||
addSampleChats();
|
||||
addSampleChats2();
|
||||
} catch (Exception e) {
|
||||
|
||||
Reference in New Issue
Block a user