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值 // 根据记忆模型类型设置默认的chatHistoryConf值
if (template.getMemModelId() != null) { if (template.getMemModelId() != null) {
if (template.getMemModelId().equals("Memory_mem0ai") if (template.getMemModelId().equals("Memory_nomem")) {
|| 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")) {
entity.setChatHistoryConf(0); entity.setChatHistoryConf(0);
} else { } else {
entity.setChatHistoryConf(template.getChatHistoryConf()); // 有记忆功能的模型,默认记录文本和语音
entity.setChatHistoryConf(2);
} }
} else { } else {
entity.setChatHistoryConf(template.getChatHistoryConf()); entity.setChatHistoryConf(template.getChatHistoryConf());
+3 -3
View File
@@ -606,10 +606,10 @@ export default {
} }
if (type === "Memory") { if (type === "Memory") {
if (value === "Memory_nomem") { if (value === "Memory_nomem") {
// 无记忆功能的模型,默认不记录聊天记录
this.form.chatHistoryConf = 0; this.form.chatHistoryConf = 0;
} else if (value === "Memory_mem0ai" || value === "Memory_mem_local_short") { } else {
this.form.chatHistoryConf = 2; // 有记忆功能的模型,默认记录文本和语音
} else if (this.form.chatHistoryConf === 0 || this.form.chatHistoryConf === null) {
this.form.chatHistoryConf = 2; this.form.chatHistoryConf = 2;
} }
} }