Skip to content

Commit

Permalink
Merge branch 'feat/workflow-backend' into deploy/dev
Browse files Browse the repository at this point in the history
  • Loading branch information
takatost committed Mar 13, 2024
2 parents 6857422 + 0c709af commit 5ab1207
Show file tree
Hide file tree
Showing 4 changed files with 614 additions and 2 deletions.
2 changes: 1 addition & 1 deletion api/core/workflow/entities/variable_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,6 @@ def get_variable_value(self, variable_selector: list[str],
ValueType.ARRAY_OBJECT,
ValueType.ARRAY_FILE]:
if not isinstance(value, list):
raise ValueError('Invalid value type: array')
raise ValueError(f'Invalid value type: {target_value_type.value}')

return value
26 changes: 26 additions & 0 deletions api/core/workflow/nodes/if_else/entities.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
from typing import Literal, Optional

from pydantic import BaseModel

from core.workflow.entities.base_node_data_entities import BaseNodeData


class IfElseNodeData(BaseNodeData):
"""
Answer Node Data.
"""
class Condition(BaseModel):
"""
Condition entity
"""
variable_selector: list[str]
comparison_operator: Literal[
# for string or array
"contains", "not contains", "start with", "end with", "is", "is not", "empty", "not empty",
# for number
"=", "≠", ">", "<", "≥", "≤", "null", "not null"
]
value: Optional[str] = None

logical_operator: Literal["and", "or"] = "and"
conditions: list[Condition]
Loading

0 comments on commit 5ab1207

Please sign in to comment.