mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-14 13:47:09 +00:00
(improvement)(chat)Add SmallTalkDemo and support multi-turn conversation in PLAIN_TEXT mode.
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
package com.tencent.supersonic.demo;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.tencent.supersonic.auth.api.authentication.pojo.User;
|
||||
import com.tencent.supersonic.chat.server.agent.Agent;
|
||||
import com.tencent.supersonic.chat.server.agent.AgentConfig;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.core.annotation.Order;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@Slf4j
|
||||
@Order(2)
|
||||
public class SmallTalkDemo extends S2BaseDemo {
|
||||
|
||||
public void doRun() {
|
||||
Agent agent = new Agent();
|
||||
agent.setName("来闲聊");
|
||||
agent.setDescription("直接与大模型对话,验证连通性");
|
||||
agent.setStatus(1);
|
||||
agent.setEnableSearch(0);
|
||||
AgentConfig agentConfig = new AgentConfig();
|
||||
agent.setAgentConfig(JSONObject.toJSONString(agentConfig));
|
||||
agent.setExamples(Lists.newArrayList("如何才能变帅",
|
||||
"如何才能赚更多钱", "如何才能世界和平"));
|
||||
|
||||
agentService.createAgent(agent, User.getFakeUser());
|
||||
}
|
||||
|
||||
@Override
|
||||
boolean checkNeedToRun() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -71,7 +71,7 @@ s2:
|
||||
path: /tmp
|
||||
|
||||
demo:
|
||||
names: S2VisitsDemo,S2ArtistDemo
|
||||
names: S2VisitsDemo,S2ArtistDemo,SmallTalkDemo
|
||||
enableLLM: true
|
||||
|
||||
# swagger配置
|
||||
|
||||
Reference in New Issue
Block a user