diff --git a/web/app/components/workflow/constants.ts b/web/app/components/workflow/constants.ts index bc652a22b3..c2bba4b40b 100644 --- a/web/app/components/workflow/constants.ts +++ b/web/app/components/workflow/constants.ts @@ -249,3 +249,10 @@ export const LLM_OUTPUT_STRUCT: Var[] = [ ], }, ] + +export const KNOWLEDGE_RETRIEVAL_OUTPUT_STRUCT: Var[] = [ + { + variable: 'result', + type: VarType.arrayObject, + }, +] 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 c449d38964..24be9ec027 100644 --- a/web/app/components/workflow/nodes/_base/components/variable/utils.ts +++ b/web/app/components/workflow/nodes/_base/components/variable/utils.ts @@ -1,7 +1,7 @@ import { BlockEnum, InputVarType, VarType } from '@/app/components/workflow/types' import type { StartNodeType } from '@/app/components/workflow/nodes/start/types' import type { NodeOutPutVar } from '@/app/components/workflow/types' -import { LLM_OUTPUT_STRUCT, SUPPORT_OUTPUT_VARS_NODE } from '@/app/components/workflow/constants' +import { KNOWLEDGE_RETRIEVAL_OUTPUT_STRUCT, LLM_OUTPUT_STRUCT, SUPPORT_OUTPUT_VARS_NODE } from '@/app/components/workflow/constants' const inputVarTypeToVarType = (type: InputVarType): VarType => { if (type === InputVarType.number) @@ -35,6 +35,11 @@ const formatItem = (item: any): NodeOutPutVar => { res.vars = LLM_OUTPUT_STRUCT break } + + case BlockEnum.KnowledgeRetrieval: { + res.vars = KNOWLEDGE_RETRIEVAL_OUTPUT_STRUCT + break + } } return res diff --git a/web/app/components/workflow/types.ts b/web/app/components/workflow/types.ts index 38dbf85780..0ae12c48c8 100644 --- a/web/app/components/workflow/types.ts +++ b/web/app/components/workflow/types.ts @@ -126,6 +126,7 @@ export enum VarType { array = 'Array', arrayString = 'Array[string]', arrayNumber = 'Array[number]', + arrayObject = 'Array[object]', } export type Var = {