From 623aaf8a0e6dd28450769a967963e05f2eaaf14e Mon Sep 17 00:00:00 2001 From: zhaoying Date: Fri, 6 Feb 2026 11:28:19 +0800 Subject: [PATCH] feat(web): use memory_config_id replace memory_content --- web/src/views/ApplicationConfig/Agent.tsx | 14 +++++++------- .../ApplicationConfig/components/Skill/index.tsx | 4 ++-- web/src/views/ApplicationConfig/types.ts | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/web/src/views/ApplicationConfig/Agent.tsx b/web/src/views/ApplicationConfig/Agent.tsx index 0bfd4ba7..6feb1548 100644 --- a/web/src/views/ApplicationConfig/Agent.tsx +++ b/web/src/views/ApplicationConfig/Agent.tsx @@ -2,7 +2,7 @@ * @Author: ZhaoYing * @Date: 2026-02-03 16:29:21 * @Last Modified by: ZhaoYing - * @Last Modified time: 2026-02-04 20:16:45 + * @Last Modified time: 2026-02-06 11:20:14 */ import { type FC, type ReactNode, useEffect, useRef, useState, forwardRef, useImperativeHandle } from 'react'; import clsx from 'clsx' @@ -38,8 +38,8 @@ import CustomSelect from '@/components/CustomSelect' import aiPrompt from '@/assets/images/application/aiPrompt.png' import AiPromptModal from './components/AiPromptModal' import ToolList from './components/ToolList/ToolList' -import ChatVariableConfigModal from './components/ChatVariableConfigModal'; import SkillList from './components/Skill' +import ChatVariableConfigModal from './components/ChatVariableConfigModal'; import type { Skill } from '@/views/Skills/types' /** @@ -169,7 +169,7 @@ const Agent = forwardRef((_props, ref) => { const { skills } = response let allSkills = Array.isArray(skills?.skill_ids) ? skills?.skill_ids.map(vo => ({ id: vo })) : [] let allTools = Array.isArray(response.tools) ? response.tools : [] - const memoryContent = response.memory?.memory_content + const memoryContent = response.memory?.memory_config_id const parsedMemoryContent = memoryContent === null || memoryContent === '' ? undefined : !isNaN(Number(memoryContent)) ? Number(memoryContent) : memoryContent @@ -178,7 +178,7 @@ const Agent = forwardRef((_props, ref) => { tools: allTools, memory: { ...response.memory, - memory_content: parsedMemoryContent + memory_config_id: parsedMemoryContent }, skills: { ...skills, @@ -262,7 +262,7 @@ const Agent = forwardRef((_props, ref) => { if (!isSave || !data) return Promise.resolve() const { memory, knowledge_retrieval, tools, skills, ...rest } = values const { knowledge_bases = [], ...knowledgeRest } = knowledge_retrieval || {} - const { memory_content } = memory || {} + const { memory_config_id } = memory || {} // Get other necessary properties of memory from original data const originalMemory = data.memory || ({} as MemoryConfig) @@ -272,7 +272,7 @@ const Agent = forwardRef((_props, ref) => { memory: { ...originalMemory, ...memory, - memory_content: memory_content ? String(memory_content) : '', + memory_config_id: memory_config_id ? String(memory_config_id) : '', }, knowledge_retrieval: knowledge_bases.length > 0 ? { ...data.knowledge_retrieval, @@ -444,7 +444,7 @@ const Agent = forwardRef((_props, ref) => { diff --git a/web/src/views/ApplicationConfig/components/Skill/index.tsx b/web/src/views/ApplicationConfig/components/Skill/index.tsx index 1a8dcc6d..d42edd3d 100644 --- a/web/src/views/ApplicationConfig/components/Skill/index.tsx +++ b/web/src/views/ApplicationConfig/components/Skill/index.tsx @@ -39,7 +39,7 @@ const processObj = [ * @param value - Current skill configuration values * @param onChange - Callback function when configuration changes */ -const Skill: FC<{value?: SkillConfigForm; onChange?: (config: SkillConfigForm) => void}> = () => { +const SkillList: FC<{value?: SkillConfigForm; onChange?: (config: SkillConfigForm) => void}> = () => { const { t } = useTranslation() const form = Form.useFormInstance() const skillConfig = Form.useWatch(['skills'], form) @@ -148,4 +148,4 @@ const Skill: FC<{value?: SkillConfigForm; onChange?: (config: SkillConfigForm) = ) } -export default Skill \ No newline at end of file +export default SkillList \ No newline at end of file diff --git a/web/src/views/ApplicationConfig/types.ts b/web/src/views/ApplicationConfig/types.ts index fc799b91..2d09f739 100644 --- a/web/src/views/ApplicationConfig/types.ts +++ b/web/src/views/ApplicationConfig/types.ts @@ -43,7 +43,7 @@ export interface MemoryConfig { /** Whether memory is enabled */ enabled: boolean; /** Memory content */ - memory_content?: string; + memory_config_id?: string; /** Maximum history length */ max_history?: number | string; }