Sfoglia il codice sorgente

fix: datasource file can not be chosen

tags/2.0.0-beta.1
Joel 2 mesi fa
parent
commit
b10d7d5b22

+ 3
- 3
web/app/components/workflow/nodes/data-source/default.ts Vedi File

LOCAL_FILE_OUTPUT, LOCAL_FILE_OUTPUT,
} from './constants' } from './constants'
import { VarType as VarKindType } from '@/app/components/workflow/nodes/tool/types' import { VarType as VarKindType } from '@/app/components/workflow/nodes/tool/types'
import type { AnyObj } from '../_base/components/variable/match-schema-type'
import { getMatchedSchemaType } from '../_base/components/variable/use-match-schema-type'


const i18nPrefix = 'workflow.errorMsg' const i18nPrefix = 'workflow.errorMsg'


errorMessage, errorMessage,
} }
}, },
getOutputVars(payload, allPluginInfoList, ragVars = [], { getMatchedSchemaType } = { getMatchedSchemaType: (_obj: AnyObj) => '' }) {
getOutputVars(payload, allPluginInfoList, ragVars = [], { schemaTypeDefinitions } = { schemaTypeDefinitions: [] }) {
const { const {
plugin_id, plugin_id,
datasource_name, datasource_name,
let type = dataType === 'array' let type = dataType === 'array'
? `array[${output.items?.type.slice(0, 1).toLocaleLowerCase()}${output.items?.type.slice(1)}]` ? `array[${output.items?.type.slice(0, 1).toLocaleLowerCase()}${output.items?.type.slice(1)}]`
: `${dataType.slice(0, 1).toLocaleLowerCase()}${dataType.slice(1)}` : `${dataType.slice(0, 1).toLocaleLowerCase()}${dataType.slice(1)}`
const schemaType = getMatchedSchemaType?.(output)
const schemaType = getMatchedSchemaType?.(output, schemaTypeDefinitions)


if (type === 'object' && schemaType === 'file') if (type === 'object' && schemaType === 'file')
type = 'file' type = 'file'

Loading…
Annulla
Salva