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 7ae9d7bf65..483ae9e9eb 100644 --- a/web/app/components/workflow/nodes/_base/components/variable/utils.ts +++ b/web/app/components/workflow/nodes/_base/components/variable/utils.ts @@ -318,12 +318,19 @@ const formatItem = ( const outputSchema: any[] = [] Object.keys(output_schema.properties).forEach((outputKey) => { const output = output_schema.properties[outputKey] + const dataType = output.type outputSchema.push({ variable: outputKey, - type: output.type === 'array' + type: dataType ? `array[${output.items?.type.slice(0, 1).toLocaleLowerCase()}${output.items?.type.slice(1)}]` : `${output.type.slice(0, 1).toLocaleLowerCase()}${output.type.slice(1)}`, description: output.description, + children: output.type === 'object' ? { + schema: { + type: 'object', + properties: output.properties, + }, + } : undefined, }) }) res.vars = [ diff --git a/web/app/components/workflow/nodes/tool/panel.tsx b/web/app/components/workflow/nodes/tool/panel.tsx index efdb60c20d..32c43730d7 100644 --- a/web/app/components/workflow/nodes/tool/panel.tsx +++ b/web/app/components/workflow/nodes/tool/panel.tsx @@ -17,6 +17,7 @@ import ResultPanel from '@/app/components/workflow/run/result-panel' import { useToolIcon } from '@/app/components/workflow/hooks' import { useLogs } from '@/app/components/workflow/run/hooks' import formatToTracingNodeList from '@/app/components/workflow/run/utils/format-log' +import StructureOutputItem from '@/app/components/workflow/nodes/_base/components/variable/object-child-tree-panel/show' const i18nPrefix = 'workflow.nodes.tool' @@ -148,12 +149,13 @@ const Panel: FC> = ({ description={t(`${i18nPrefix}.outputVars.json`)} /> {outputSchema.map(outputItem => ( - + // + ))}