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
e686d422
Commit
e686d422
authored
Mar 13, 2024
by
Joel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: support template transform output var
parent
9bca3f8f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
1 deletion
+13
-1
constants.ts
web/app/components/workflow/constants.ts
+7
-0
utils.ts
...ponents/workflow/nodes/_base/components/variable/utils.ts
+6
-1
No files found.
web/app/components/workflow/constants.ts
View file @
e686d422
...
...
@@ -256,3 +256,10 @@ export const KNOWLEDGE_RETRIEVAL_OUTPUT_STRUCT: Var[] = [
type
:
VarType
.
arrayObject
,
},
]
export
const
TEMPLATE_TRANSFORM_OUTPUT_STRUCT
:
Var
[]
=
[
{
variable
:
'output'
,
type
:
VarType
.
string
,
},
]
web/app/components/workflow/nodes/_base/components/variable/utils.ts
View file @
e686d422
...
...
@@ -2,7 +2,7 @@ import type { CodeNodeType } from '../../../code/types'
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
{
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
=>
{
if
(
type
===
InputVarType
.
number
)
...
...
@@ -54,6 +54,11 @@ const formatItem = (item: any): NodeOutPutVar => {
})
break
}
case
BlockEnum
.
TemplateTransform
:
{
res
.
vars
=
TEMPLATE_TRANSFORM_OUTPUT_STRUCT
break
}
}
return
res
...
...
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