Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dify
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ai-tech
dify
Commits
0d2366b4
Commit
0d2366b4
authored
Mar 13, 2024
by
Joel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: knowledge output var
parent
b13345ce
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
1 deletion
+14
-1
constants.ts
web/app/components/workflow/constants.ts
+7
-0
utils.ts
...ponents/workflow/nodes/_base/components/variable/utils.ts
+6
-1
types.ts
web/app/components/workflow/types.ts
+1
-0
No files found.
web/app/components/workflow/constants.ts
View file @
0d2366b4
...
...
@@ -249,3 +249,10 @@ export const LLM_OUTPUT_STRUCT: Var[] = [
],
},
]
export
const
KNOWLEDGE_RETRIEVAL_OUTPUT_STRUCT
:
Var
[]
=
[
{
variable
:
'result'
,
type
:
VarType
.
arrayObject
,
},
]
web/app/components/workflow/nodes/_base/components/variable/utils.ts
View file @
0d2366b4
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
...
...
web/app/components/workflow/types.ts
View file @
0d2366b4
...
...
@@ -126,6 +126,7 @@ export enum VarType {
array
=
'Array'
,
arrayString
=
'Array[string]'
,
arrayNumber
=
'Array[number]'
,
arrayObject
=
'Array[object]'
,
}
export
type
Var
=
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment