mirror of
https://github.com/langgenius/dify.git
synced 2026-03-14 11:28:34 +08:00
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
30 lines
736 B
Python
30 lines
736 B
Python
from typing import Literal
|
|
|
|
from pydantic import BaseModel, Field
|
|
|
|
from dify_graph.entities.base_node_data import BaseNodeData
|
|
from dify_graph.enums import NodeType
|
|
from dify_graph.utils.condition.entities import Condition
|
|
|
|
|
|
class IfElseNodeData(BaseNodeData):
|
|
"""
|
|
If Else Node Data.
|
|
"""
|
|
|
|
type: NodeType = NodeType.IF_ELSE
|
|
|
|
class Case(BaseModel):
|
|
"""
|
|
Case entity representing a single logical condition group
|
|
"""
|
|
|
|
case_id: str
|
|
logical_operator: Literal["and", "or"]
|
|
conditions: list[Condition]
|
|
|
|
logical_operator: Literal["and", "or"] | None = "and"
|
|
conditions: list[Condition] | None = Field(default=None, deprecated=True)
|
|
|
|
cases: list[Case] | None = None
|