diff --git a/web/app/components/base/prompt-editor/index.tsx b/web/app/components/base/prompt-editor/index.tsx index e5fb642c4c..4a718527b8 100644 --- a/web/app/components/base/prompt-editor/index.tsx +++ b/web/app/components/base/prompt-editor/index.tsx @@ -79,6 +79,7 @@ export type PromptEditorProps = { variableBlock?: VariableBlockType externalToolBlock?: ExternalToolBlockType workflowVariableBlock?: WorkflowVariableBlockType + isSupportFileVar?: boolean } const PromptEditor: FC = ({ @@ -99,6 +100,7 @@ const PromptEditor: FC = ({ variableBlock, externalToolBlock, workflowVariableBlock, + isSupportFileVar, }) => { const { eventEmitter } = useEventEmitterContextContext() const initialConfig = { @@ -159,6 +161,7 @@ const PromptEditor: FC = ({ variableBlock={variableBlock} externalToolBlock={externalToolBlock} workflowVariableBlock={workflowVariableBlock} + isSupportFileVar={isSupportFileVar} /> = ({ variableBlock={variableBlock} externalToolBlock={externalToolBlock} workflowVariableBlock={workflowVariableBlock} + isSupportFileVar={isSupportFileVar} /> { contextBlock?.show && ( diff --git a/web/app/components/base/prompt-editor/plugins/component-picker-block/index.tsx b/web/app/components/base/prompt-editor/plugins/component-picker-block/index.tsx index 2624c309bb..a5cb39f383 100644 --- a/web/app/components/base/prompt-editor/plugins/component-picker-block/index.tsx +++ b/web/app/components/base/prompt-editor/plugins/component-picker-block/index.tsx @@ -40,6 +40,7 @@ type ComponentPickerProps = { variableBlock?: VariableBlockType externalToolBlock?: ExternalToolBlockType workflowVariableBlock?: WorkflowVariableBlockType + isSupportFileVar?: boolean } const ComponentPicker = ({ triggerString, @@ -49,6 +50,7 @@ const ComponentPicker = ({ variableBlock, externalToolBlock, workflowVariableBlock, + isSupportFileVar, }: ComponentPickerProps) => { const { eventEmitter } = useEventEmitterContextContext() const { refs, floatingStyles, isPositioned } = useFloating({ @@ -178,6 +180,7 @@ const ComponentPicker = ({ handleSelectWorkflowVariable(variables) }} maxHeightClass='max-h-[34vh]' + isSupportFileVar={isSupportFileVar} /> diff --git a/web/app/components/workflow/nodes/_base/components/prompt/editor.tsx b/web/app/components/workflow/nodes/_base/components/prompt/editor.tsx index 080346b18d..66923fbe1f 100644 --- a/web/app/components/workflow/nodes/_base/components/prompt/editor.tsx +++ b/web/app/components/workflow/nodes/_base/components/prompt/editor.tsx @@ -58,6 +58,7 @@ type Props = { } nodesOutputVars?: NodeOutPutVar[] availableNodes?: Node[] + isSupportFileVar?: boolean isSupportPromptGenerator?: boolean onGenerated?: (prompt: string) => void modelConfig?: ModelConfig @@ -86,6 +87,7 @@ const Editor: FC = ({ hasSetBlockStatus, nodesOutputVars, availableNodes = [], + isSupportFileVar, isSupportPromptGenerator, isSupportJinja, editionType, @@ -245,6 +247,7 @@ const Editor: FC = ({ onBlur={setBlur} onFocus={setFocus} editable={!readOnly} + isSupportFileVar={isSupportFileVar} /> {/* to patch Editor not support dynamic change editable status */} {readOnly &&
} diff --git a/web/app/components/workflow/nodes/answer/panel.tsx b/web/app/components/workflow/nodes/answer/panel.tsx index daa5be4e66..acfcff66fb 100644 --- a/web/app/components/workflow/nodes/answer/panel.tsx +++ b/web/app/components/workflow/nodes/answer/panel.tsx @@ -38,6 +38,7 @@ const Panel: FC> = ({ onChange={handleAnswerChange} nodesOutputVars={availableVars} availableNodes={availableNodesWithParent} + isSupportFileVar /> )