From 936fb8b8a1c7500b2246b5a9c732fb1d03dd9114 Mon Sep 17 00:00:00 2001 From: zhaoying Date: Mon, 9 Feb 2026 20:11:48 +0800 Subject: [PATCH] feat(web): memory-write add messages config --- web/src/i18n/en.ts | 2 +- web/src/i18n/zh.ts | 2 +- web/src/views/Workflow/components/Properties/index.tsx | 4 ++-- web/src/views/Workflow/constant.ts | 8 +++++++- web/src/views/Workflow/hooks/useWorkflowGraph.ts | 9 ++++++--- 5 files changed, 17 insertions(+), 8 deletions(-) diff --git a/web/src/i18n/en.ts b/web/src/i18n/en.ts index b5e16a9e..0e936f01 100644 --- a/web/src/i18n/en.ts +++ b/web/src/i18n/en.ts @@ -2105,7 +2105,7 @@ Memory Bear: After the rebellion, regional warlordism intensified for several re search_switch: 'Search Mode', }, 'memory-write': { - message: 'Message', + messages: 'Message', config_id: 'Memory Configuration', search_switch: 'Search Mode', }, diff --git a/web/src/i18n/zh.ts b/web/src/i18n/zh.ts index 7739523c..135446fe 100644 --- a/web/src/i18n/zh.ts +++ b/web/src/i18n/zh.ts @@ -2200,7 +2200,7 @@ export const zh = { search_switch: '检索模式', }, 'memory-write': { - message: '消息', + messages: '消息', config_id: '记忆配置', search_switch: '检索模式', }, diff --git a/web/src/views/Workflow/components/Properties/index.tsx b/web/src/views/Workflow/components/Properties/index.tsx index 8180fd63..9e6e418b 100644 --- a/web/src/views/Workflow/components/Properties/index.tsx +++ b/web/src/views/Workflow/components/Properties/index.tsx @@ -2,7 +2,7 @@ * @Author: ZhaoYing * @Date: 2026-02-03 15:39:59 * @Last Modified by: ZhaoYing - * @Last Modified time: 2026-02-05 14:21:45 + * @Last Modified time: 2026-02-09 19:56:42 */ import { type FC, useEffect, useState, useMemo } from "react"; import clsx from 'clsx' @@ -491,7 +491,7 @@ const Properties: FC = ({ if (config.type === 'messageEditor') { return ( - + { - if (key === 'memory' && nodeLibraryConfig.config && nodeLibraryConfig.config[key]) { + if (type === 'memory-write' && key === 'message' && nodeLibraryConfig.config) { + nodeLibraryConfig.config['messages'].defaultValue = [{ role: 'USER', content: config[key] }] + delete nodeLibraryConfig.config[key] + } else if (key === 'memory' && nodeLibraryConfig.config && nodeLibraryConfig.config[key]) { const { memory, messages } = config as any; if (memory?.enable && messages && messages.length > 0) { const lastMessage = messages[messages.length - 1]