mirror of https://github.com/langgenius/dify.git
feat: knowledge output var
This commit is contained in:
parent
b13345ceb2
commit
0d2366b432
|
|
@ -249,3 +249,10 @@ export const LLM_OUTPUT_STRUCT: Var[] = [
|
|||
],
|
||||
},
|
||||
]
|
||||
|
||||
export const KNOWLEDGE_RETRIEVAL_OUTPUT_STRUCT: Var[] = [
|
||||
{
|
||||
variable: 'result',
|
||||
type: VarType.arrayObject,
|
||||
},
|
||||
]
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -126,6 +126,7 @@ export enum VarType {
|
|||
array = 'Array',
|
||||
arrayString = 'Array[string]',
|
||||
arrayNumber = 'Array[number]',
|
||||
arrayObject = 'Array[object]',
|
||||
}
|
||||
|
||||
export type Var = {
|
||||
|
|
|
|||
Loading…
Reference in New Issue