Commit e686d422 authored by Joel's avatar Joel

feat: support template transform output var

parent 9bca3f8f
...@@ -256,3 +256,10 @@ export const KNOWLEDGE_RETRIEVAL_OUTPUT_STRUCT: Var[] = [ ...@@ -256,3 +256,10 @@ export const KNOWLEDGE_RETRIEVAL_OUTPUT_STRUCT: Var[] = [
type: VarType.arrayObject, type: VarType.arrayObject,
}, },
] ]
export const TEMPLATE_TRANSFORM_OUTPUT_STRUCT: Var[] = [
{
variable: 'output',
type: VarType.string,
},
]
...@@ -2,7 +2,7 @@ import type { CodeNodeType } from '../../../code/types' ...@@ -2,7 +2,7 @@ import type { CodeNodeType } from '../../../code/types'
import { BlockEnum, InputVarType, VarType } from '@/app/components/workflow/types' import { BlockEnum, InputVarType, VarType } from '@/app/components/workflow/types'
import type { StartNodeType } from '@/app/components/workflow/nodes/start/types' import type { StartNodeType } from '@/app/components/workflow/nodes/start/types'
import type { NodeOutPutVar } from '@/app/components/workflow/types' import type { NodeOutPutVar } from '@/app/components/workflow/types'
import { KNOWLEDGE_RETRIEVAL_OUTPUT_STRUCT, LLM_OUTPUT_STRUCT, SUPPORT_OUTPUT_VARS_NODE } from '@/app/components/workflow/constants' import { KNOWLEDGE_RETRIEVAL_OUTPUT_STRUCT, LLM_OUTPUT_STRUCT, SUPPORT_OUTPUT_VARS_NODE, TEMPLATE_TRANSFORM_OUTPUT_STRUCT } from '@/app/components/workflow/constants'
const inputVarTypeToVarType = (type: InputVarType): VarType => { const inputVarTypeToVarType = (type: InputVarType): VarType => {
if (type === InputVarType.number) if (type === InputVarType.number)
...@@ -54,6 +54,11 @@ const formatItem = (item: any): NodeOutPutVar => { ...@@ -54,6 +54,11 @@ const formatItem = (item: any): NodeOutPutVar => {
}) })
break break
} }
case BlockEnum.TemplateTransform: {
res.vars = TEMPLATE_TRANSFORM_OUTPUT_STRUCT
break
}
} }
return res return res
......
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