Commit 0d2366b4 authored by Joel's avatar Joel

feat: knowledge output var

parent b13345ce
......@@ -249,3 +249,10 @@ export const LLM_OUTPUT_STRUCT: Var[] = [
],
},
]
export const KNOWLEDGE_RETRIEVAL_OUTPUT_STRUCT: Var[] = [
{
variable: 'result',
type: VarType.arrayObject,
},
]
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
......
......@@ -126,6 +126,7 @@ export enum VarType {
array = 'Array',
arrayString = 'Array[string]',
arrayNumber = 'Array[number]',
arrayObject = 'Array[object]',
}
export type Var = {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment