diff --git a/web/app/components/workflow/hooks/use-checklist.ts b/web/app/components/workflow/hooks/use-checklist.ts index 306139cfa2..167b8936c7 100644 --- a/web/app/components/workflow/hooks/use-checklist.ts +++ b/web/app/components/workflow/hooks/use-checklist.ts @@ -41,7 +41,7 @@ import type { DataSet } from '@/models/datasets' import { fetchDatasets } from '@/service/datasets' import { MAX_TREE_DEPTH } from '@/config' import useNodesAvailableVarList from './use-nodes-available-var-list' -import { getNodeUsedVars, isConversationVar, isENV, isSystemVar } from '../nodes/_base/components/variable/utils' +import { getNodeUsedVars, isSpecialVar } from '../nodes/_base/components/variable/utils' export const useChecklist = (nodes: Node[], edges: Edge[]) => { const { t } = useTranslation() @@ -122,10 +122,8 @@ export const useChecklist = (nodes: Node[], edges: Edge[]) => { const availableVars = map[node.id].availableVars for (const variable of usedVars) { - const isEnv = isENV(variable) - const isConvVar = isConversationVar(variable) - const isSysVar = isSystemVar(variable) - if (!isEnv && !isConvVar && !isSysVar) { + const isSpecialVars = isSpecialVar(variable[0]) + if (!isSpecialVars) { const usedNode = availableVars.find(v => v.nodeId === variable?.[0]) if (usedNode) { const usedVar = usedNode.vars.find(v => v.variable === variable?.[1]) @@ -165,7 +163,7 @@ export const useChecklist = (nodes: Node[], edges: Edge[]) => { }) return list - }, [nodes, edges, buildInTools, customTools, workflowTools, language, nodesExtraData, t, strategyProviders, getCheckData, getStartNodes, getToolIcon, dataSourceList]) + }, [nodes, getStartNodes, nodesExtraData, edges, buildInTools, customTools, workflowTools, language, dataSourceList, getToolIcon, strategyProviders, getCheckData, t, map]) return needWarningNodes } diff --git a/web/app/components/workflow/nodes/_base/components/variable-tag.tsx b/web/app/components/workflow/nodes/_base/components/variable-tag.tsx index d73a3d4924..0815f85134 100644 --- a/web/app/components/workflow/nodes/_base/components/variable-tag.tsx +++ b/web/app/components/workflow/nodes/_base/components/variable-tag.tsx @@ -14,7 +14,7 @@ import { BlockEnum } from '@/app/components/workflow/types' import { Line3 } from '@/app/components/base/icons/src/public/common' import { Variable02 } from '@/app/components/base/icons/src/vender/solid/development' import { BubbleX, Env } from '@/app/components/base/icons/src/vender/line/others' -import { getNodeInfoById, isConversationVar, isENV, isSystemVar } from '@/app/components/workflow/nodes/_base/components/variable/utils' +import { getNodeInfoById, isConversationVar, isENV, isRagVariableVar, isSystemVar } from '@/app/components/workflow/nodes/_base/components/variable/utils' import Tooltip from '@/app/components/base/tooltip' import cn from '@/utils/classnames' import { isExceptionVariable } from '@/app/components/workflow/utils' @@ -43,7 +43,8 @@ const VariableTag = ({ const isEnv = isENV(valueSelector) const isChatVar = isConversationVar(valueSelector) - const isValid = Boolean(node) || isEnv || isChatVar + const isRagVar = isRagVariableVar(valueSelector) + const isValid = Boolean(node) || isEnv || isChatVar || isRagVar const variableName = isSystemVar(valueSelector) ? valueSelector.slice(0).join('.') : valueSelector.slice(1).join('.') const isException = isExceptionVariable(variableName, node?.data.type) diff --git a/web/app/components/workflow/nodes/_base/components/variable/var-reference-picker.tsx b/web/app/components/workflow/nodes/_base/components/variable/var-reference-picker.tsx index 3026226452..2ee35b855b 100644 --- a/web/app/components/workflow/nodes/_base/components/variable/var-reference-picker.tsx +++ b/web/app/components/workflow/nodes/_base/components/variable/var-reference-picker.tsx @@ -295,7 +295,7 @@ const VarReferencePicker: FC = ({ const isEnv = isENV(value as ValueSelector) const isChatVar = isConversationVar(value as ValueSelector) const isRagVar = isRagVariableVar(value as ValueSelector) - const isValidVar = Boolean(outputVarNode) || isEnv || isChatVar + const isValidVar = Boolean(outputVarNode) || isEnv || isChatVar || isRagVar const isException = isExceptionVariable(varName, outputVarNode?.type) return { isEnv,