fix:设置有记忆的模型为默认时,chatHistoryConf=2

This commit is contained in:
rainv123
2025-11-21 18:39:57 +08:00
parent b15b5af349
commit 1e5b03edb5
2 changed files with 7 additions and 9 deletions
@@ -398,14 +398,12 @@ public class AgentServiceImpl extends BaseServiceImpl<AgentDao, AgentEntity> imp
// 根据记忆模型类型设置默认的chatHistoryConf值
if (template.getMemModelId() != null) {
if (template.getMemModelId().equals("Memory_mem0ai")
|| template.getMemModelId().equals("Memory_mem_local_short")) {
// 当记忆模型是Memory_mem0ai或Memory_mem_local_short时,默认chatHistoryConf设为2
entity.setChatHistoryConf(2);
} else if (template.getMemModelId().equals("Memory_nomem")) {
if (template.getMemModelId().equals("Memory_nomem")) {
// 无记忆功能的模型,默认不记录聊天记录
entity.setChatHistoryConf(0);
} else {
entity.setChatHistoryConf(template.getChatHistoryConf());
// 有记忆功能的模型,默认记录文本和语音
entity.setChatHistoryConf(2);
}
} else {
entity.setChatHistoryConf(template.getChatHistoryConf());