From 1e5b03edb59e1102f44913c6a89917f6803aa603 Mon Sep 17 00:00:00 2001 From: rainv123 <2148537152@qq.com> Date: Fri, 21 Nov 2025 18:39:57 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E8=AE=BE=E7=BD=AE=E6=9C=89=E8=AE=B0?= =?UTF-8?q?=E5=BF=86=E7=9A=84=E6=A8=A1=E5=9E=8B=E4=B8=BA=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E6=97=B6=EF=BC=8CchatHistoryConf=3D2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/agent/service/impl/AgentServiceImpl.java | 10 ++++------ main/manager-web/src/views/roleConfig.vue | 6 +++--- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/main/manager-api/src/main/java/xiaozhi/modules/agent/service/impl/AgentServiceImpl.java b/main/manager-api/src/main/java/xiaozhi/modules/agent/service/impl/AgentServiceImpl.java index a888f8d9..cb550b3e 100644 --- a/main/manager-api/src/main/java/xiaozhi/modules/agent/service/impl/AgentServiceImpl.java +++ b/main/manager-api/src/main/java/xiaozhi/modules/agent/service/impl/AgentServiceImpl.java @@ -398,14 +398,12 @@ public class AgentServiceImpl extends BaseServiceImpl 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()); diff --git a/main/manager-web/src/views/roleConfig.vue b/main/manager-web/src/views/roleConfig.vue index 9d833e59..a0baf371 100644 --- a/main/manager-web/src/views/roleConfig.vue +++ b/main/manager-web/src/views/roleConfig.vue @@ -606,10 +606,10 @@ export default { } if (type === "Memory") { if (value === "Memory_nomem") { + // 无记忆功能的模型,默认不记录聊天记录 this.form.chatHistoryConf = 0; - } else if (value === "Memory_mem0ai" || value === "Memory_mem_local_short") { - this.form.chatHistoryConf = 2; - } else if (this.form.chatHistoryConf === 0 || this.form.chatHistoryConf === null) { + } else { + // 有记忆功能的模型,默认记录文本和语音 this.form.chatHistoryConf = 2; } }