From 9e0f906face5e275d72972a30e2e74f76cb1ef85 Mon Sep 17 00:00:00 2001 From: Novice Date: Fri, 13 Feb 2026 14:12:16 +0800 Subject: [PATCH] feat: update tooltips for better clarity --- .../visual-editor/edit-card/index.tsx | 17 ++++++++++++++++- .../nodes/llm/components/tools/index.tsx | 2 +- web/i18n/en-US/workflow.json | 1 + web/i18n/zh-Hans/workflow.json | 1 + 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/visual-editor/edit-card/index.tsx b/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/visual-editor/edit-card/index.tsx index 33232ed0a3..311e2a5fa9 100644 --- a/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/visual-editor/edit-card/index.tsx +++ b/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/visual-editor/edit-card/index.tsx @@ -6,7 +6,9 @@ import { useUnmount } from 'ahooks' import * as React from 'react' import { useCallback, useMemo, useRef, useState } from 'react' import { useTranslation } from 'react-i18next' +import { useStore as useAppStore } from '@/app/components/app/store' import Divider from '@/app/components/base/divider' +import { useFeatures } from '@/app/components/base/features/hooks' import { JSON_SCHEMA_MAX_DEPTH } from '@/config' import { cn } from '@/utils/classnames' import { ArrayType, Type } from '../../../../types' @@ -61,6 +63,10 @@ const MAXIMUM_DEPTH_TYPE_OPTIONS = [ { value: ArrayType.file, text: 'array[file]' }, ] +const FILE_TYPES: Set = new Set([Type.file, ArrayType.file]) + +const filterFileTypes = (options: TypeItem[]) => options.filter(o => !FILE_TYPES.has(o.value)) + const EditCard: FC = ({ fields, depth, @@ -77,11 +83,20 @@ const EditCard: FC = ({ const { emit, useSubscribe } = useMittContext() const blurWithActions = useRef(false) + const isSandboxRuntime = useAppStore(s => s.appDetail?.runtime_type === 'sandboxed') + const features = useFeatures(s => s.features) + const isSupportSandbox = isSandboxRuntime || features.sandbox?.enabled === true + const maximumDepthReached = depth === JSON_SCHEMA_MAX_DEPTH const disableAddBtn = maximumDepthReached || (currentFields.type !== Type.object && currentFields.type !== ArrayType.object) const hasAdvancedOptions = currentFields.type === Type.string || currentFields.type === Type.number const isAdvancedEditing = advancedEditing || isAddingNewField + const typeOptions = useMemo(() => { + const base = maximumDepthReached ? MAXIMUM_DEPTH_TYPE_OPTIONS : TYPE_OPTIONS + return isSupportSandbox ? base : filterFileTypes(base) + }, [maximumDepthReached, isSupportSandbox]) + const advancedOptions = useMemo(() => { let enumValue = '' if (currentFields.type === Type.string || currentFields.type === Type.number) @@ -234,7 +249,7 @@ const EditCard: FC = ({ /> diff --git a/web/app/components/workflow/nodes/llm/components/tools/index.tsx b/web/app/components/workflow/nodes/llm/components/tools/index.tsx index 8ad9b0fa1e..83fefdaf8a 100644 --- a/web/app/components/workflow/nodes/llm/components/tools/index.tsx +++ b/web/app/components/workflow/nodes/llm/components/tools/index.tsx @@ -53,7 +53,7 @@ const Tools = ({ availableNodes={[]} value={tools} label={t('nodes.llm.tools.title', { ns: 'workflow' })} - tooltip={t('nodes.llm.tools.title', { ns: 'workflow' })} + tooltip={t('nodes.llm.tools.tooltip', { ns: 'workflow' })} onChange={handleToolsChange} supportCollapse disabled={isDisabled} diff --git a/web/i18n/en-US/workflow.json b/web/i18n/en-US/workflow.json index 6192d715be..88390747b2 100644 --- a/web/i18n/en-US/workflow.json +++ b/web/i18n/en-US/workflow.json @@ -848,6 +848,7 @@ "nodes.llm.sysQueryInUser": "sys.query in user message is required", "nodes.llm.tools.disabledByStructuredOutput": "Tools are disabled when Structured Output is enabled.", "nodes.llm.tools.title": "Tools", + "nodes.llm.tools.tooltip": "Enable the LLM to call external tools during execution. The model autonomously decides when and which tools to invoke based on context, and may iterate multiple times to refine results.", "nodes.llm.variables": "variables", "nodes.llm.vision": "vision", "nodes.loop.ErrorMethod.continueOnError": "Continue on Error", diff --git a/web/i18n/zh-Hans/workflow.json b/web/i18n/zh-Hans/workflow.json index a9aa85c4b7..012af23694 100644 --- a/web/i18n/zh-Hans/workflow.json +++ b/web/i18n/zh-Hans/workflow.json @@ -840,6 +840,7 @@ "nodes.llm.singleRun.variable": "变量", "nodes.llm.sysQueryInUser": "user message 中必须包含 sys.query", "nodes.llm.tools.disabledByStructuredOutput": "启用结构化输出时,将禁用工具。", + "nodes.llm.tools.tooltip": "允许 LLM 在执行过程中调用外部工具。模型会根据上下文自主决定何时调用哪些工具,并可多次迭代以优化结果。", "nodes.llm.variables": "变量", "nodes.llm.vision": "视觉", "nodes.loop.ErrorMethod.continueOnError": "忽略错误并继续",