fix(agent-ext-fields): 完善 agent 扩展字段前后端实现

- AgentServiceImpl/ConfigServiceImpl 后端逻辑

- edit.vue/roleConfig.vue 前端编辑与角色配置
This commit is contained in:
SerenNoble 2026-07-16 15:12:10 +08:00
parent d81a7fa31f
commit f9f4e08b9a
4 changed files with 7 additions and 7 deletions

View file

@ -97,7 +97,7 @@ public class AgentServiceImpl extends BaseServiceImpl<AgentDao, AgentEntity> imp
agent.setChatHistoryConf(Constant.ChatHistoryConfEnum.IGNORE.getCode()); agent.setChatHistoryConf(Constant.ChatHistoryConfEnum.IGNORE.getCode());
} }
if (agent.getChatHistoryConf() == null) { if (agent.getChatHistoryConf() == null) {
agent.setChatHistoryConf(Constant.ChatHistoryConfEnum.RECORD_TEXT_AUDIO.getCode()); agent.setChatHistoryConf(Constant.ChatHistoryConfEnum.RECORD_TEXT.getCode());
} }
// 查询上下文源配置 // 查询上下文源配置
@ -501,8 +501,8 @@ public class AgentServiceImpl extends BaseServiceImpl<AgentDao, AgentEntity> imp
// 无记忆功能的模型,默认不记录聊天记录 // 无记忆功能的模型,默认不记录聊天记录
entity.setChatHistoryConf(0); entity.setChatHistoryConf(0);
} else { } else {
// 有记忆功能的模型,默认记录文本和语音 // 有记忆功能的模型,默认记录文本
entity.setChatHistoryConf(2); entity.setChatHistoryConf(1);
} }
} else { } else {
entity.setChatHistoryConf(template.getChatHistoryConf()); entity.setChatHistoryConf(template.getChatHistoryConf());

View file

@ -189,7 +189,7 @@ public class ConfigServiceImpl implements ConfigService {
} else if (agent.getMemModelId() != null } else if (agent.getMemModelId() != null
&& !agent.getMemModelId().equals(Constant.MEMORY_NO_MEM) && !agent.getMemModelId().equals(Constant.MEMORY_NO_MEM)
&& agent.getChatHistoryConf() == null) { && agent.getChatHistoryConf() == null) {
chatHistoryConf = Constant.ChatHistoryConfEnum.RECORD_TEXT_AUDIO.getCode(); chatHistoryConf = Constant.ChatHistoryConfEnum.RECORD_TEXT.getCode();
} }
result.put("chat_history_conf", chatHistoryConf); result.put("chat_history_conf", chatHistoryConf);
// 如果客户端已实例化模型,则不返回 // 如果客户端已实例化模型,则不返回

View file

@ -490,7 +490,7 @@ async function onPickerConfirm(type: string, value: any, name: string) {
break break
case 'memory': case 'memory':
formData.value.memModelId = value formData.value.memModelId = value
formData.value.chatHistoryConf = value === 'Memory_nomem' ? 0 : 2 formData.value.chatHistoryConf = value === 'Memory_nomem' ? 0 : 1
displayNames.value.memory = name // 确保显示名称正确更新 displayNames.value.memory = name // 确保显示名称正确更新
displayNames.value.report = reportOptions[1].name displayNames.value.report = reportOptions[1].name
isVisibleReport.value = value !== 'Memory_nomem' isVisibleReport.value = value !== 'Memory_nomem'

View file

@ -954,8 +954,8 @@ export default {
// 无记忆功能的模型,默认不记录聊天记录 // 无记忆功能的模型,默认不记录聊天记录
this.form.chatHistoryConf = 0; this.form.chatHistoryConf = 0;
} else { } else {
// 有记忆功能的模型,默认记录文本和语音 // 有记忆功能的模型,默认记录文本
this.form.chatHistoryConf = 2; this.form.chatHistoryConf = 1;
} }
if (value === "Memory_nomem" || value === "Memory_mem_report_only") { if (value === "Memory_nomem" || value === "Memory_mem_report_only") {
this.tempSummaryMemory = this.form.summaryMemory; this.tempSummaryMemory = this.form.summaryMemory;