diff --git a/web/app/components/workflow/nodes/llm/panel.tsx b/web/app/components/workflow/nodes/llm/panel.tsx index 76607b29b1..1def75cdf7 100644 --- a/web/app/components/workflow/nodes/llm/panel.tsx +++ b/web/app/components/workflow/nodes/llm/panel.tsx @@ -67,6 +67,7 @@ const Panel: FC> = ({ handleStop, varInputs, runResult, + filterJinjia2InputVar, } = useConfig(id, data) const model = inputs.model @@ -194,7 +195,7 @@ const Panel: FC> = ({ list={inputs.prompt_config?.jinja2_variables || []} onChange={handleVarListChange} onVarNameChange={handleVarNameChange} - filterVar={filterVar} + filterVar={filterJinjia2InputVar} /> )} @@ -233,6 +234,7 @@ const Panel: FC> = ({ hasSetBlockStatus={hasSetBlockStatus} nodesOutputVars={availableVars} availableNodes={availableNodesWithParent} + isSupportFileVar /> {inputs.memory.query_prompt_template && !inputs.memory.query_prompt_template.includes('{{#sys.query#}}') && ( diff --git a/web/app/components/workflow/nodes/llm/use-config.ts b/web/app/components/workflow/nodes/llm/use-config.ts index 1b84f81110..dd550d7ba8 100644 --- a/web/app/components/workflow/nodes/llm/use-config.ts +++ b/web/app/components/workflow/nodes/llm/use-config.ts @@ -281,6 +281,10 @@ const useConfig = (id: string, payload: LLMNodeType) => { return [VarType.number, VarType.string, VarType.secret, VarType.arrayString, VarType.arrayNumber, VarType.arrayFile].includes(varPayload.type) }, []) + const filterJinjia2InputVar = useCallback((varPayload: Var) => { + return [VarType.number, VarType.string, VarType.secret, VarType.arrayString, VarType.arrayNumber].includes(varPayload.type) + }, []) + const filterMemoryPromptVar = useCallback((varPayload: Var) => { return [VarType.arrayObject, VarType.array, VarType.number, VarType.string, VarType.secret, VarType.arrayString, VarType.arrayNumber, VarType.arrayFile].includes(varPayload.type) }, []) @@ -406,6 +410,7 @@ const useConfig = (id: string, payload: LLMNodeType) => { handleRun, handleStop, runResult, + filterJinjia2InputVar, } }