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
cb2a8142
Commit
cb2a8142
authored
Mar 13, 2024
by
Joel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: assign output
parent
db78b91e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
2 deletions
+19
-2
utils.ts
...ponents/workflow/nodes/_base/components/variable/utils.ts
+13
-0
var-reference-picker.tsx
.../nodes/_base/components/variable/var-reference-picker.tsx
+4
-0
types.ts
web/app/components/workflow/nodes/variable-assigner/types.ts
+2
-2
No files found.
web/app/components/workflow/nodes/_base/components/variable/utils.ts
View file @
cb2a8142
...
...
@@ -2,6 +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
type
{
VariableAssignerNodeType
}
from
'@/app/components/workflow/nodes/variable-assigner/types'
import
{
CHAT_QUESTION_CLASSIFIER_OUTPUT_STRUCT
,
COMPLETION_QUESTION_CLASSIFIER_OUTPUT_STRUCT
,
...
...
@@ -77,6 +78,18 @@ const formatItem = (item: any, isChatMode: boolean): NodeOutPutVar => {
res
.
vars
=
HTTP_REQUEST_OUTPUT_STRUCT
break
}
case
BlockEnum
.
VariableAssigner
:
{
const
{
output_type
,
}
=
data
as
VariableAssignerNodeType
res
.
vars
=
[
{
variable
:
'output'
,
type
:
output_type
,
},
]
}
}
return
res
...
...
web/app/components/workflow/nodes/_base/components/variable/var-reference-picker.tsx
View file @
cb2a8142
...
...
@@ -2,6 +2,7 @@
import
type
{
FC
}
from
'react'
import
React
,
{
useState
}
from
'react'
import
cn
from
'classnames'
import
{
isArray
}
from
'lodash-es'
import
VarReferencePopup
from
'./var-reference-popup'
import
{
toNodeOutputVars
}
from
'./utils'
import
type
{
ValueSelector
}
from
'@/app/components/workflow/types'
...
...
@@ -29,6 +30,9 @@ type Props = {
}
export
const
getNodeInfoById
=
(
nodes
:
any
,
id
:
string
)
=>
{
if
(
!
isArray
(
nodes
))
return
return
nodes
.
find
((
node
:
any
)
=>
node
.
id
===
id
)
}
...
...
web/app/components/workflow/nodes/variable-assigner/types.ts
View file @
cb2a8142
import
type
{
CommonNodeType
,
ValueSelector
}
from
'@/app/components/workflow/types'
import
type
{
CommonNodeType
,
ValueSelector
,
VarType
}
from
'@/app/components/workflow/types'
export
type
VariableAssignerNodeType
=
CommonNodeType
&
{
output_type
:
string
output_type
:
VarType
variables
:
ValueSelector
[]
}
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