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
6ef3542c
Commit
6ef3542c
authored
Mar 13, 2024
by
takatost
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix value type
parent
db299a87
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
variable_pool.py
api/core/workflow/entities/variable_pool.py
+8
-2
No files found.
api/core/workflow/entities/variable_pool.py
View file @
6ef3542c
...
@@ -13,7 +13,10 @@ class ValueType(Enum):
...
@@ -13,7 +13,10 @@ class ValueType(Enum):
STRING
=
"string"
STRING
=
"string"
NUMBER
=
"number"
NUMBER
=
"number"
OBJECT
=
"object"
OBJECT
=
"object"
ARRAY
=
"array"
ARRAY_STRING
=
"array[string]"
ARRAY_NUMBER
=
"array[number]"
ARRAY_OBJECT
=
"array[object]"
ARRAY_FILE
=
"array[file]"
FILE
=
"file"
FILE
=
"file"
...
@@ -78,7 +81,10 @@ class VariablePool:
...
@@ -78,7 +81,10 @@ class VariablePool:
elif
target_value_type
==
ValueType
.
OBJECT
:
elif
target_value_type
==
ValueType
.
OBJECT
:
if
not
isinstance
(
value
,
dict
):
if
not
isinstance
(
value
,
dict
):
raise
ValueError
(
'Invalid value type: object'
)
raise
ValueError
(
'Invalid value type: object'
)
elif
target_value_type
==
ValueType
.
ARRAY
:
elif
target_value_type
in
[
ValueType
.
ARRAY_STRING
,
ValueType
.
ARRAY_NUMBER
,
ValueType
.
ARRAY_OBJECT
,
ValueType
.
ARRAY_FILE
]:
if
not
isinstance
(
value
,
list
):
if
not
isinstance
(
value
,
list
):
raise
ValueError
(
'Invalid value type: array'
)
raise
ValueError
(
'Invalid value type: array'
)
...
...
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