mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-10 11:07:06 +00:00
(improvement)(chat)Turn on multi-turn conversation for SmallTalkDemo.
This commit is contained in:
@@ -26,10 +26,11 @@ import static com.tencent.supersonic.chat.server.parser.ParserConfig.PARSER_MULT
|
||||
public class PlainTextExecutor implements ChatExecutor {
|
||||
|
||||
private static final String INSTRUCTION = ""
|
||||
+ "#Role: You are a nice person to talked to.\n"
|
||||
+ "#Task: You will have a small talk with the user, please respond quickly and nicely."
|
||||
+ "#History Conversations: %s\n"
|
||||
+ "#Current User Input: %s\n"
|
||||
+ "#Role: You are a nice person to talk to.\n"
|
||||
+ "#Task: Respond quickly and nicely to the user."
|
||||
+ "#Rules: 1.ALWAYS use the same language as the input.\n"
|
||||
+ "#History Inputs: %s\n"
|
||||
+ "#Current Input: %s\n"
|
||||
+ "#Your response: ";
|
||||
|
||||
@Override
|
||||
|
||||
@@ -6,6 +6,7 @@ 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 com.tencent.supersonic.chat.server.agent.MultiTurnConfig;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.core.annotation.Order;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -25,6 +26,9 @@ public class SmallTalkDemo extends S2BaseDemo {
|
||||
agent.setAgentConfig(JSONObject.toJSONString(agentConfig));
|
||||
agent.setExamples(Lists.newArrayList("如何才能变帅",
|
||||
"如何才能赚更多钱", "如何才能世界和平"));
|
||||
MultiTurnConfig multiTurnConfig = new MultiTurnConfig();
|
||||
multiTurnConfig.setEnableMultiTurn(true);
|
||||
agent.setMultiTurnConfig(multiTurnConfig);
|
||||
|
||||
agentService.createAgent(agent, User.getFakeUser());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user