From 5475496399e9ecf8f90dfd3ae568e841befeda2c Mon Sep 17 00:00:00 2001 From: zhaoying Date: Thu, 5 Feb 2026 14:25:16 +0800 Subject: [PATCH] feat(web): llm node config add vision,vision_input --- web/src/i18n/en.ts | 1 + web/src/i18n/zh.ts | 1 + .../Properties/MemoryConfig/index.tsx | 2 +- .../Workflow/components/Properties/index.tsx | 29 +++++++++++++++---- web/src/views/Workflow/constant.ts | 14 ++++++++- 5 files changed, 39 insertions(+), 8 deletions(-) diff --git a/web/src/i18n/en.ts b/web/src/i18n/en.ts index d3c788df..943c37b3 100644 --- a/web/src/i18n/en.ts +++ b/web/src/i18n/en.ts @@ -1882,6 +1882,7 @@ Memory Bear: After the rebellion, regional warlordism intensified for several re enable_window: 'Memory Window', inner: 'Built-in', messagesPlaceholder: 'Write prompts here, type "{" to insert variables, type "insert" to insert', + vision: 'Vision', }, start: { variables: 'Input Fields', diff --git a/web/src/i18n/zh.ts b/web/src/i18n/zh.ts index 4e1e52e4..65dadf49 100644 --- a/web/src/i18n/zh.ts +++ b/web/src/i18n/zh.ts @@ -1970,6 +1970,7 @@ export const zh = { enable_window: '记忆窗口', inner: '内置', messagesPlaceholder: '在此处编写提示,输入“{”插入变量,输入“insert”插入', + vision: '视觉', }, start: { variables: '输入字段', diff --git a/web/src/views/Workflow/components/Properties/MemoryConfig/index.tsx b/web/src/views/Workflow/components/Properties/MemoryConfig/index.tsx index c994df62..9e33e73e 100644 --- a/web/src/views/Workflow/components/Properties/MemoryConfig/index.tsx +++ b/web/src/views/Workflow/components/Properties/MemoryConfig/index.tsx @@ -55,7 +55,7 @@ const MemoryConfig: FC<{ options: Suggestion[]; parentName: string; }> = ({ - {t('workflow.config.llm.enable_window')} + {t('workflow.config.llm.enable_window')} diff --git a/web/src/views/Workflow/components/Properties/index.tsx b/web/src/views/Workflow/components/Properties/index.tsx index 59860005..8180fd63 100644 --- a/web/src/views/Workflow/components/Properties/index.tsx +++ b/web/src/views/Workflow/components/Properties/index.tsx @@ -1,8 +1,8 @@ /* * @Author: ZhaoYing * @Date: 2026-02-03 15:39:59 - * @Last Modified by: ZhaoYing - * @Last Modified time: 2026-02-03 15:39:59 + * @Last Modified by: ZhaoYing + * @Last Modified time: 2026-02-05 14:21:45 */ import { type FC, useEffect, useState, useMemo } from "react"; import clsx from 'clsx' @@ -612,11 +612,19 @@ const Properties: FC = ({ ) } + if (key === 'vision_input' && !values?.vision) { + return null + } + return ( {t(`workflow.config.${selectedNode?.data?.type}.${key}`)} : t(`workflow.config.${selectedNode?.data?.type}.${key}`)} + label={key === 'vision_input' + ? undefined : key === 'parallel_count' + ? {t(`workflow.config.${selectedNode?.data?.type}.${key}`)} + : t(`workflow.config.${selectedNode?.data?.type}.${key}`) + } layout={config.type === 'switch' ? 'horizontal' : 'vertical'} className={key === 'parallel_count' ? 'rb:-mt-3! rb:leading-3.5!' : ''} > @@ -655,13 +663,16 @@ const Properties: FC = ({ // Apply filtering if specified in config if (config.filterNodeTypes || config.filterVariableNames) { return baseVariableList.filter(variable => { - const nodeTypeMatch = !config.filterNodeTypes || + const nodeTypeMatch = !config.filterNodeTypes || (Array.isArray(config.filterNodeTypes) && config.filterNodeTypes.includes(variable.nodeData?.type)); - const variableNameMatch = !config.filterVariableNames || + const variableNameMatch = !config.filterVariableNames || (Array.isArray(config.filterVariableNames) && config.filterVariableNames.includes(variable.label)); return nodeTypeMatch || variableNameMatch; }); } + if (config.onFilterVariableNames) { + return baseVariableList.filter(variable => Array.isArray(config.onFilterVariableNames) && config.onFilterVariableNames.includes(variable.label)); + } // Filter child nodes for iteration output if (config.filterChildNodes && selectedNode) { const graph = graphRef.current; @@ -685,7 +696,13 @@ const Properties: FC = ({ size="small" /> : config.type === 'switch' - ? { form.setFieldValue('group_variables', []) } : undefined} /> + ? { form.setFieldValue('group_variables', []) } + : key === 'vision' + ? () => { form.setFieldValue('vision_input', undefined) } + : undefined + } /> : config.type === 'categoryList' ?