diff --git a/web/app/components/workflow/constants.ts b/web/app/components/workflow/constants.ts index c0d06c6b58..a7f56d645d 100644 --- a/web/app/components/workflow/constants.ts +++ b/web/app/components/workflow/constants.ts @@ -312,3 +312,14 @@ export const HTTP_REQUEST_OUTPUT_STRUCT: Var[] = [ type: VarType.string, }, ] + +export const TOOL_OUTPUT_STRUCT: Var[] = [ + { + variable: 'text', + type: VarType.string, + }, + { + variable: 'files', + type: VarType.arrayFile, + }, +] diff --git a/web/app/components/workflow/nodes/_base/components/variable/utils.ts b/web/app/components/workflow/nodes/_base/components/variable/utils.ts index ec3d314472..84ef27d5fd 100644 --- a/web/app/components/workflow/nodes/_base/components/variable/utils.ts +++ b/web/app/components/workflow/nodes/_base/components/variable/utils.ts @@ -11,6 +11,7 @@ import { LLM_OUTPUT_STRUCT, SUPPORT_OUTPUT_VARS_NODE, TEMPLATE_TRANSFORM_OUTPUT_STRUCT, + TOOL_OUTPUT_STRUCT, } from '@/app/components/workflow/constants' const inputVarTypeToVarType = (type: InputVarType): VarType => { @@ -89,6 +90,12 @@ const formatItem = (item: any, isChatMode: boolean): NodeOutPutVar => { type: output_type, }, ] + break + } + + case BlockEnum.Tool: { + res.vars = TOOL_OUTPUT_STRUCT + break } } diff --git a/web/app/components/workflow/nodes/tool/panel.tsx b/web/app/components/workflow/nodes/tool/panel.tsx index d588b6a1aa..1f973c7e19 100644 --- a/web/app/components/workflow/nodes/tool/panel.tsx +++ b/web/app/components/workflow/nodes/tool/panel.tsx @@ -12,6 +12,7 @@ import Form from '@/app/components/header/account-setting/model-provider-page/mo import ConfigCredential from '@/app/components/tools/setting/build-in/config-credentials' import Loading from '@/app/components/base/loading' import BeforeRunForm from '@/app/components/workflow/nodes/_base/components/before-run-form' +import OutputVars, { VarItem } from '@/app/components/workflow/nodes/_base/components/output-vars' const i18nPrefix = 'workflow.nodes.tool' @@ -110,6 +111,45 @@ const Panel: FC> = ({ /> )} +
+ + <> + + + + +
+ {isShowSingleRun && (