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 4872d6714c..d09ffd8cf5 100644 --- a/web/app/components/workflow/nodes/_base/components/variable/utils.ts +++ b/web/app/components/workflow/nodes/_base/components/variable/utils.ts @@ -523,17 +523,19 @@ const formatItem = ( const dynamicOutputSchema: any[] = [] Object.keys(payload.output_schema.properties).forEach((outputKey) => { const output = payload.output_schema!.properties[outputKey] - const dataType = output.type + const dataType = output?.properties?.dify_builtin_type ? output.properties.dify_builtin_type.enum[0] : output.type dynamicOutputSchema.push({ variable: outputKey, type: dataType === 'array' ? `array[${output.items?.type.slice(0, 1).toLocaleLowerCase()}${output.items?.type.slice(1)}]` - : `${output.type.slice(0, 1).toLocaleLowerCase()}${output.type.slice(1)}`, + : `${dataType.slice(0, 1).toLocaleLowerCase()}${dataType.slice(1)}`, description: output.description, children: output.type === 'object' ? { schema: { type: 'object', - properties: output.properties, + properties: Object.fromEntries( + Object.entries(output.properties).filter(([key]) => key !== 'dify_builtin_type'), + ), }, } : undefined, }) diff --git a/web/app/components/workflow/nodes/data-source/constants.ts b/web/app/components/workflow/nodes/data-source/constants.ts index 70bc7b0fb5..f0f40e1af0 100644 --- a/web/app/components/workflow/nodes/data-source/constants.ts +++ b/web/app/components/workflow/nodes/data-source/constants.ts @@ -39,42 +39,42 @@ export const LOCAL_FILE_OUTPUT = [ { name: 'name', type: VarType.string, - description: '', + description: 'file name', }, { name: 'size', type: VarType.number, - description: '', + description: 'file size', }, { name: 'type', type: VarType.string, - description: '', + description: 'file type', }, { name: 'extension', type: VarType.string, - description: '', + description: 'file extension', }, { name: 'mime_type', type: VarType.string, - description: '', + description: 'file mime type', }, { name: 'transfer_method', type: VarType.string, - description: '', + description: 'file transfer method', }, { name: 'url', type: VarType.string, - description: '', + description: 'file url', }, { name: 'related_id', type: VarType.string, - description: '', + description: 'file related id', }, ], }, diff --git a/web/app/components/workflow/nodes/data-source/default.ts b/web/app/components/workflow/nodes/data-source/default.ts index 835e4a1dfa..f3a9e3e4cc 100644 --- a/web/app/components/workflow/nodes/data-source/default.ts +++ b/web/app/components/workflow/nodes/data-source/default.ts @@ -6,9 +6,6 @@ import { BlockEnum } from '@/app/components/workflow/types' import { COMMON_OUTPUT, LOCAL_FILE_OUTPUT, - ONLINE_DOCUMENT_OUTPUT, - ONLINE_DRIVE_OUTPUT, - WEBSITE_CRAWL_OUTPUT, } from './constants' import { VarType as VarKindType } from '@/app/components/workflow/nodes/tool/types' @@ -61,9 +58,6 @@ const nodeDefault: NodeDefault = { provider_type, } = payload const isLocalFile = provider_type === DataSourceClassification.localFile - const isWebsiteCrawl = provider_type === DataSourceClassification.websiteCrawl - const isOnlineDocument = provider_type === DataSourceClassification.onlineDocument - const isOnlineDrive = provider_type === DataSourceClassification.onlineDrive return [ ...COMMON_OUTPUT.map(item => ({ variable: item.name, type: item.type })), ...( @@ -71,21 +65,6 @@ const nodeDefault: NodeDefault = { ? LOCAL_FILE_OUTPUT.map(item => ({ variable: item.name, type: item.type })) : [] ), - ...( - isWebsiteCrawl - ? WEBSITE_CRAWL_OUTPUT.map(item => ({ variable: item.name, type: item.type })) - : [] - ), - ...( - isOnlineDocument - ? ONLINE_DOCUMENT_OUTPUT.map(item => ({ variable: item.name, type: item.type })) - : [] - ), - ...( - isOnlineDrive - ? ONLINE_DRIVE_OUTPUT.map(item => ({ variable: item.name, type: item.type })) - : [] - ), ...ragVars, ] }, diff --git a/web/app/components/workflow/nodes/llm/types.ts b/web/app/components/workflow/nodes/llm/types.ts index c1d33a2e92..8314592e6a 100644 --- a/web/app/components/workflow/nodes/llm/types.ts +++ b/web/app/components/workflow/nodes/llm/types.ts @@ -28,6 +28,7 @@ export enum Type { arrayString = 'array[string]', arrayNumber = 'array[number]', arrayObject = 'array[object]', + file = 'file', } export enum ArrayType {