From 8d4c5b5b339d0b56f3134592496125d960cf9833 Mon Sep 17 00:00:00 2001 From: zhaoying Date: Fri, 6 Feb 2026 14:03:32 +0800 Subject: [PATCH] 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 ? <>