From 623aaf8a0e6dd28450769a967963e05f2eaaf14e Mon Sep 17 00:00:00 2001 From: zhaoying Date: Fri, 6 Feb 2026 11:28:19 +0800 Subject: [PATCH 1/2] 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; } From 8d4c5b5b339d0b56f3134592496125d960cf9833 Mon Sep 17 00:00:00 2001 From: zhaoying Date: Fri, 6 Feb 2026 14:03:32 +0800 Subject: [PATCH 2/2] feat(web): memory extraction engine add custom_text --- web/src/api/memory.ts | 2 +- web/src/i18n/en.ts | 3 ++- web/src/i18n/zh.ts | 3 ++- .../MemoryExtractionEngine/components/Result.tsx | 13 ++++++++++++- 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/web/src/api/memory.ts b/web/src/api/memory.ts index 6f4e7f0e..987ef358 100644 --- a/web/src/api/memory.ts +++ b/web/src/api/memory.ts @@ -256,7 +256,7 @@ export const updateMemoryExtractionConfig = (values: ExtractionConfigForm) => { return request.post('/memory-storage/update_config_extracted', values) } // Memory Extraction Engine - Pilot run -export const pilotRunMemoryExtractionConfig = (values: { config_id: number | string; dialogue_text: string; }, onMessage?: (data: SSEMessage[]) => void) => { +export const pilotRunMemoryExtractionConfig = (values: { config_id: number | string; dialogue_text: string; custom_text?: string; }, onMessage?: (data: SSEMessage[]) => void) => { return handleSSE('/memory-storage/pilot_run', values, onMessage) } // Emotion Engine - Get configuration diff --git a/web/src/i18n/en.ts b/web/src/i18n/en.ts index fe0fbc37..9d706ff6 100644 --- a/web/src/i18n/en.ts +++ b/web/src/i18n/en.ts @@ -1543,7 +1543,8 @@ Memory Bear: After the rebellion, regional warlordism intensified for several re text_preprocessing_desc: 'Text split into {{count}} semantic fragments', knowledge_extraction_desc: 'Knowledge extraction completed, identified {{entities}} entities, {{statements}} statements, {{temporal_ranges_count}} temporal extractions, {{triplets}} triplets', creating_nodes_edges_desc: 'Entity relationship creation completed, {{num}} relationships in total', - deduplication_desc: 'Deduplication and disambiguation completed, {{count}} unique entities in total' + deduplication_desc: 'Deduplication and disambiguation completed, {{count}} unique entities in total', + custom_text: 'Debug Text', }, memoryConversation: { searchPlaceholder: 'Enter user ID...', diff --git a/web/src/i18n/zh.ts b/web/src/i18n/zh.ts index 7fc8b652..a7ef34ac 100644 --- a/web/src/i18n/zh.ts +++ b/web/src/i18n/zh.ts @@ -1617,7 +1617,8 @@ export const zh = { text_preprocessing_desc: '文本切分为{{count}}个语义片段', knowledge_extraction_desc: '知识抽取完成,共识别{{entities}}个实体,{{statements}}个句子, {{temporal_ranges_count}}个时间提取, {{triplets}}个三元组', creating_nodes_edges_desc: '实体关系创建完成,共{{num}}条关系', - deduplication_desc: '去重消歧完成,最终{{count}}个唯一实体' + deduplication_desc: '去重消歧完成,最终{{count}}个唯一实体', + custom_text: '调试文本', }, memoryConversation: { chatEmpty:'有什么我可以帮您的吗?', diff --git a/web/src/views/MemoryExtractionEngine/components/Result.tsx b/web/src/views/MemoryExtractionEngine/components/Result.tsx index 6fdeb2af..cb89661a 100644 --- a/web/src/views/MemoryExtractionEngine/components/Result.tsx +++ b/web/src/views/MemoryExtractionEngine/components/Result.tsx @@ -13,7 +13,7 @@ import { type FC, useState } from 'react' import { useParams } from 'react-router-dom' import { useTranslation } from 'react-i18next' -import { Space, Button, Progress } from 'antd' +import { Space, Button, Progress, Form, Input } from 'antd' import { ExclamationCircleFilled, CheckCircleFilled, ClockCircleOutlined, LoadingOutlined } from '@ant-design/icons' import clsx from 'clsx' import type { AnyObject } from 'antd/es/_util/type'; @@ -79,6 +79,8 @@ const Result: FC = ({ loading, handleSave }) => { const [creatingNodesEdges, setCreatingNodesEdges] = useState(initObj as ModuleItem) const [deduplication, setDeduplication] = useState(initObj as ModuleItem) + const [runForm] = Form.useForm() + /** Run pilot test */ const handleRun = () => { if(!id) return @@ -187,6 +189,7 @@ const Result: FC = ({ loading, handleSave }) => { pilotRunMemoryExtractionConfig({ config_id: id, dialogue_text: t('memoryExtractionEngine.exampleText'), + custom_text: runForm.getFieldValue('custom_text') }, handleStreamMessage) .finally(() => { setRunLoading(false) @@ -222,6 +225,14 @@ const Result: FC = ({ loading, handleSave }) => { headerClassName="rb:pb-0! rb:pt-4!" bodyClassName="rb:min-h-[calc(100vh-388px)] rb:p-[16px_20px]!" > +
+ + + +
{runLoading ? <>