From 5960b5add8341de9eab2747f24aa15a8cd033b88 Mon Sep 17 00:00:00 2001 From: zhaoying Date: Thu, 23 Apr 2026 16:58:07 +0800 Subject: [PATCH 1/4] feat(web): document-extractor add images output variable --- .../Workflow/components/Properties/hooks/useVariableList.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/web/src/views/Workflow/components/Properties/hooks/useVariableList.ts b/web/src/views/Workflow/components/Properties/hooks/useVariableList.ts index 994a0ae1..f979d924 100644 --- a/web/src/views/Workflow/components/Properties/hooks/useVariableList.ts +++ b/web/src/views/Workflow/components/Properties/hooks/useVariableList.ts @@ -56,6 +56,8 @@ const NODE_VARIABLES = { ], 'document-extractor': [ { label: 'text', dataType: 'string', field: 'text' }, + // { label: 'chunks', dataType: 'array[string]', field: 'chunks' }, + { label: 'images', dataType: 'array[file]', field: 'images' }, ], 'list-operator': [ { label: 'result', dataType: 'array[string]', field: 'result' }, From 279353e1ce51da15aa23cc9bcc33b2a7b8ea8e94 Mon Sep 17 00:00:00 2001 From: zhaoying Date: Fri, 24 Apr 2026 11:52:11 +0800 Subject: [PATCH 2/4] feat(web): file upload add document_image_recognition config --- web/src/i18n/en.ts | 3 +++ web/src/i18n/zh.ts | 3 +++ .../FeaturesConfig/FileUploadSettingModal.tsx | 22 ++++++++++++++----- .../OpenStatementSettingModal.tsx | 1 + .../components/ModelConfigModal.tsx | 3 ++- web/src/views/ApplicationConfig/types.ts | 2 ++ 6 files changed, 28 insertions(+), 6 deletions(-) diff --git a/web/src/i18n/en.ts b/web/src/i18n/en.ts index 31354817..e5a80431 100644 --- a/web/src/i18n/en.ts +++ b/web/src/i18n/en.ts @@ -1460,6 +1460,7 @@ export const en = { maxCount: 'Max Files', singleMaxSize: 'Max Size', unix: 'items', + document_image_recognition: 'Enable image recognition in documents', text_to_speech: 'Text to Speech', text_to_speech_desc: 'Text can be converted to speech', opening_statement: 'Conversation Opening', @@ -1536,6 +1537,7 @@ export const en = { json_output: 'Support JSON formatted output', thinking_budget_tokens: 'thinking budget tokens', thinking_budget_tokens_max_error: "Cannot exceed the max tokens limit ({{max}})", + logSearchPlaceholder: 'Search log content', }, userMemory: { userMemory: 'User Memory', @@ -2529,6 +2531,7 @@ Memory Bear: After the rebellion, regional warlordism intensified for several re input_result: 'Input', output_result: 'Output', + process_result: 'Data Processing', error: 'Error Message', loopNum: ' loops', iterationNum: ' iterations', diff --git a/web/src/i18n/zh.ts b/web/src/i18n/zh.ts index d802b731..8d71876e 100644 --- a/web/src/i18n/zh.ts +++ b/web/src/i18n/zh.ts @@ -790,6 +790,7 @@ export const zh = { maxCount: '最大文件数', singleMaxSize: '单文件最大大小', unix: '个', + document_image_recognition: '是否识别文档中的图片', text_to_speech: '文字转语音', text_to_speech_desc: '文本可以转换成语音', opening_statement: '对话开场白', @@ -866,6 +867,7 @@ export const zh = { json_output: '支持JSON格式化输出', thinking_budget_tokens: '深度思考预算Token数', thinking_budget_tokens_max_error: "不能超过 最大令牌数 ({{max}})", + logSearchPlaceholder: '搜索日志内容', }, table: { totalRecords: '共 {{total}} 条记录' @@ -2493,6 +2495,7 @@ export const zh = { input_result: '输入', output_result: '输出', + process_result: '数据处理', error: '错误信息', loopNum: '个循环', iterationNum: '个迭代', diff --git a/web/src/views/ApplicationConfig/components/FeaturesConfig/FileUploadSettingModal.tsx b/web/src/views/ApplicationConfig/components/FeaturesConfig/FileUploadSettingModal.tsx index 5c17aa53..2ae09a5e 100644 --- a/web/src/views/ApplicationConfig/components/FeaturesConfig/FileUploadSettingModal.tsx +++ b/web/src/views/ApplicationConfig/components/FeaturesConfig/FileUploadSettingModal.tsx @@ -97,6 +97,7 @@ export const defaultValues: FileUpload = { "json", "md", ], + document_image_recognition: false, video_enabled: false, video_max_size_mb: 100, video_allowed_extensions: [ @@ -219,11 +220,22 @@ const FileUploadSettingModal = forwardRef {isEnabled && ( - -
{t('application.singleMaxSize')}:
- - - + +
+
{t('application.singleMaxSize')}
+ + + +
+ {option.type === 'document' && +
+
{t('application.document_image_recognition')}
+ + + +
+ } +
)} diff --git a/web/src/views/ApplicationConfig/components/FeaturesConfig/OpenStatementSettingModal.tsx b/web/src/views/ApplicationConfig/components/FeaturesConfig/OpenStatementSettingModal.tsx index a46d973a..ed9204da 100644 --- a/web/src/views/ApplicationConfig/components/FeaturesConfig/OpenStatementSettingModal.tsx +++ b/web/src/views/ApplicationConfig/components/FeaturesConfig/OpenStatementSettingModal.tsx @@ -104,6 +104,7 @@ const OpenStatementSettingModal = forwardRef {source === 'workflow' ? diff --git a/web/src/views/ApplicationConfig/components/ModelConfigModal.tsx b/web/src/views/ApplicationConfig/components/ModelConfigModal.tsx index a7f9eb57..bda18571 100644 --- a/web/src/views/ApplicationConfig/components/ModelConfigModal.tsx +++ b/web/src/views/ApplicationConfig/components/ModelConfigModal.tsx @@ -184,7 +184,8 @@ const ModelConfigModal = forwardRef( { validator: (_, value) => { const maxTokens = values?.max_tokens - if (value !== undefined && maxTokens !== undefined && value > maxTokens) { + const deep_thinking = values?.deep_thinking; + if (deep_thinking && value !== undefined && maxTokens !== undefined && value > maxTokens) { return Promise.reject(t('application.thinking_budget_tokens_max_error', { max: maxTokens })) } return Promise.resolve() diff --git a/web/src/views/ApplicationConfig/types.ts b/web/src/views/ApplicationConfig/types.ts index 1b54d3aa..c34f882f 100644 --- a/web/src/views/ApplicationConfig/types.ts +++ b/web/src/views/ApplicationConfig/types.ts @@ -438,6 +438,7 @@ interface FileSetttings { document_enabled: boolean; document_max_size_mb: number; document_allowed_extensions: string[]; + document_image_recognition: boolean; video_enabled: boolean; video_max_size_mb: number; video_allowed_extensions: string[]; @@ -499,6 +500,7 @@ export interface LogItem { is_draft: boolean; created_at: number; updated_at: number; + node_executions_map?: Record } export interface LogDetailModalRef { handleOpen: (vo: LogItem) => void; From c556995f3a65e85445273a105d1ce4cdbdec131a Mon Sep 17 00:00:00 2001 From: zhaoying Date: Fri, 24 Apr 2026 15:10:32 +0800 Subject: [PATCH 3/4] feat(web): app citation features add allow_download --- web/src/assets/images/application/export.svg | 8 ++--- web/src/assets/images/application/import.svg | 8 ++--- web/src/components/Chat/ChatContent.tsx | 24 +++++++++----- web/src/components/Chat/types.ts | 3 +- web/src/i18n/en.ts | 1 + web/src/i18n/zh.ts | 1 + web/src/views/ApplicationConfig/Agent.tsx | 32 ++++++++++--------- .../FeaturesConfig/FeaturesConfigModal.tsx | 6 ++++ 8 files changed, 51 insertions(+), 32 deletions(-) diff --git a/web/src/assets/images/application/export.svg b/web/src/assets/images/application/export.svg index c07a346d..6dde8f3c 100644 --- a/web/src/assets/images/application/export.svg +++ b/web/src/assets/images/application/export.svg @@ -1,12 +1,12 @@ - 导出 + 导入 - - + + - + diff --git a/web/src/assets/images/application/import.svg b/web/src/assets/images/application/import.svg index 6dde8f3c..c07a346d 100644 --- a/web/src/assets/images/application/import.svg +++ b/web/src/assets/images/application/import.svg @@ -1,12 +1,12 @@ - 导入 + 导出 - - + + - + diff --git a/web/src/components/Chat/ChatContent.tsx b/web/src/components/Chat/ChatContent.tsx index f28b5dce..f4c89578 100644 --- a/web/src/components/Chat/ChatContent.tsx +++ b/web/src/components/Chat/ChatContent.tsx @@ -272,14 +272,22 @@ const ChatContent: FC = ({
{t('memoryConversation.citations')}
{item.meta_data?.citations?.map((citation, idx) => ( -
{ - const params = new URLSearchParams({ documentId: citation.document_id, parentId: citation.knowledge_id }); - window.open(`/#/knowledge-base/${citation.knowledge_id}/DocumentDetails?${params}`, '_blank'); - }} - >{citation.file_name}
+ +
{ + const params = new URLSearchParams({ documentId: citation.document_id, parentId: citation.knowledge_id }); + window.open(`/#/knowledge-base/${citation.knowledge_id}/DocumentDetails?${params}`, '_blank'); + }} + >{citation.file_name}
+ + {citation.download_url && +
handleDownload({ url: citation.download_url })} + >
+ } +
))}
} diff --git a/web/src/components/Chat/types.ts b/web/src/components/Chat/types.ts index e7967bad..f251db3a 100644 --- a/web/src/components/Chat/types.ts +++ b/web/src/components/Chat/types.ts @@ -24,7 +24,7 @@ export interface ChatItem { subContent?: Record[]; error?: string; meta_data?: { - audio_url?: string; + audio_url?: string | null; audio_status?: string; files?: any[]; suggested_questions?: string[]; @@ -33,6 +33,7 @@ export interface ChatItem { file_name: string; knowledge_id: string; score: string; + download_url?: string; }[]; reasoning_content?: string; }, diff --git a/web/src/i18n/en.ts b/web/src/i18n/en.ts index e5a80431..2a7534c4 100644 --- a/web/src/i18n/en.ts +++ b/web/src/i18n/en.ts @@ -1470,6 +1470,7 @@ export const en = { add_questions: 'Add Option', citation: 'Citation and Attribution', citation_desc: 'Display the attribution of source documents and generated content', + allow_download: 'Allow downloading cited source text', invalidVariablesTitle: "The following undefined variables are referenced in the conversation opening. Do you want to save the opening configuration?", deep_thinking: 'Enable Deep Thinking', diff --git a/web/src/i18n/zh.ts b/web/src/i18n/zh.ts index 8d71876e..6989cf3f 100644 --- a/web/src/i18n/zh.ts +++ b/web/src/i18n/zh.ts @@ -800,6 +800,7 @@ export const zh = { add_questions: '添加选项', citation: '引用和归属', citation_desc: '显示源文档和生成内容的归属部分', + allow_download: '允许下载引用原文', invalidVariablesTitle: "对话开场白中引用了以下未定义的变量,是否保存开场白配置?", deep_thinking: '开启深度思考', diff --git a/web/src/views/ApplicationConfig/Agent.tsx b/web/src/views/ApplicationConfig/Agent.tsx index 4d86fba7..338f50f9 100644 --- a/web/src/views/ApplicationConfig/Agent.tsx +++ b/web/src/views/ApplicationConfig/Agent.tsx @@ -7,7 +7,7 @@ import { useEffect, useRef, useState, forwardRef, useImperativeHandle, useMemo } from 'react'; import { useTranslation } from 'react-i18next' import { useParams } from 'react-router-dom'; -import { Row, Col, Space, Form, Input, Button, App, Spin, Flex } from 'antd' +import { Row, Col, Space, Form, Input, Button, App, Flex } from 'antd' import Chat from './components/Chat' import RbCard from '@/components/RbCard/Card' @@ -357,21 +357,23 @@ const Agent = forwardRef m[1]))] - const variables = values?.variables - const validNames = new Set(variables.map(v => v.name)) - const invalid = usedVars.filter(v => !validNames.has(v)) - if (invalid.length > 0) { - const newVars = invalid.map((name, i) => ({ - index: variables.length + i, - name, - display_name: name, - type: 'text', - required: true, - max_length: 48, - })) + if (value.opening_statement.enabled) { + const usedVars = [...new Set([...(statement?.matchAll(/\{\{(\w+)\}\}/g) ?? [])].map(m => m[1]))] + const variables = values?.variables + const validNames = new Set(variables.map(v => v.name)) + const invalid = usedVars.filter(v => !validNames.has(v)) + if (invalid.length > 0) { + const newVars = invalid.map((name, i) => ({ + index: variables.length + i, + name, + display_name: name, + type: 'text', + required: true, + max_length: 48, + })) - form.setFieldValue('variables', [...variables, ...newVars]) + form.setFieldValue('variables', [...variables, ...newVars]) + } } } const modelLogo = useMemo(() => { diff --git a/web/src/views/ApplicationConfig/components/FeaturesConfig/FeaturesConfigModal.tsx b/web/src/views/ApplicationConfig/components/FeaturesConfig/FeaturesConfigModal.tsx index 57d11295..e3664a03 100644 --- a/web/src/views/ApplicationConfig/components/FeaturesConfig/FeaturesConfigModal.tsx +++ b/web/src/views/ApplicationConfig/components/FeaturesConfig/FeaturesConfigModal.tsx @@ -155,6 +155,12 @@ const FeaturesConfigModal = forwardRef +
From c7c1570d406472d82dcb2c17157ee086664df01d Mon Sep 17 00:00:00 2001 From: zhaoying Date: Fri, 24 Apr 2026 15:18:14 +0800 Subject: [PATCH 4/4] feat(web): app citations --- web/src/components/Chat/ChatContent.tsx | 3 +-- web/src/views/ApplicationConfig/Agent.tsx | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/web/src/components/Chat/ChatContent.tsx b/web/src/components/Chat/ChatContent.tsx index f4c89578..a785ea49 100644 --- a/web/src/components/Chat/ChatContent.tsx +++ b/web/src/components/Chat/ChatContent.tsx @@ -272,9 +272,8 @@ const ChatContent: FC = ({
{t('memoryConversation.citations')}
{item.meta_data?.citations?.map((citation, idx) => ( - +
{ const params = new URLSearchParams({ documentId: citation.document_id, parentId: citation.knowledge_id }); diff --git a/web/src/views/ApplicationConfig/Agent.tsx b/web/src/views/ApplicationConfig/Agent.tsx index 338f50f9..d7455793 100644 --- a/web/src/views/ApplicationConfig/Agent.tsx +++ b/web/src/views/ApplicationConfig/Agent.tsx @@ -357,7 +357,7 @@ const Agent = forwardRef m[1]))] const variables = values?.variables const validNames = new Set(variables.map(v => v.name))