From 3c4ab0632da984243273d5ffa87c73f566ecaf5e Mon Sep 17 00:00:00 2001 From: Joel Date: Fri, 9 Aug 2024 11:38:40 +0800 Subject: [PATCH] feat: tool support file type --- .../model-provider-page/declarations.ts | 1 + .../nodes/tool/components/input-var-list.tsx | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/web/app/components/header/account-setting/model-provider-page/declarations.ts b/web/app/components/header/account-setting/model-provider-page/declarations.ts index 1547032163..8a84376bea 100644 --- a/web/app/components/header/account-setting/model-provider-page/declarations.ts +++ b/web/app/components/header/account-setting/model-provider-page/declarations.ts @@ -14,6 +14,7 @@ export enum FormTypeEnum { radio = 'radio', boolean = 'boolean', files = 'files', + file = 'file', } export type FormOption = { diff --git a/web/app/components/workflow/nodes/tool/components/input-var-list.tsx b/web/app/components/workflow/nodes/tool/components/input-var-list.tsx index bfa4a542bd..931c42f2c2 100644 --- a/web/app/components/workflow/nodes/tool/components/input-var-list.tsx +++ b/web/app/components/workflow/nodes/tool/components/input-var-list.tsx @@ -127,7 +127,8 @@ const InputVarList: FC = ({ const varInput = value[variable] const isNumber = type === FormTypeEnum.textNumber const isSelect = type === FormTypeEnum.select - const isFile = type === FormTypeEnum.files + const isFile = type === FormTypeEnum.file + const isFileArray = type === FormTypeEnum.files const isString = type !== FormTypeEnum.textNumber && type !== FormTypeEnum.files && type !== FormTypeEnum.select return (
@@ -165,6 +166,18 @@ const InputVarList: FC = ({ /> )} {isFile && ( + varPayload.type === VarType.file} + /> + )} + {isFileArray && (