Skip to content

Node

llmfy.flow_engine.node.node

START = '__start__' module-attribute

END = '__end__' module-attribute

NodeType

Bases: Enum

Types of nodes in the workflow

Source code in llmfy/flow_engine/node/node.py
class NodeType(Enum):
    """Types of nodes in the workflow"""
    START = "start"
    END = "end"
    FUNCTION = "function"
    CONDITIONAL = "conditional"

START = 'start' class-attribute instance-attribute

END = 'end' class-attribute instance-attribute

FUNCTION = 'function' class-attribute instance-attribute

CONDITIONAL = 'conditional' class-attribute instance-attribute

Node dataclass

Represents a node in the workflow graph

Source code in llmfy/flow_engine/node/node.py
@dataclass
class Node:
    """Represents a node in the workflow graph"""
    name: str
    node_type: NodeType
    func: Optional[Callable] = None
    sources: List[str] = field(default_factory=list)
    targets: List[str] = field(default_factory=list)
    stream: bool = field(default=False)

name instance-attribute

node_type instance-attribute

func = None class-attribute instance-attribute

sources = field(default_factory=list) class-attribute instance-attribute

targets = field(default_factory=list) class-attribute instance-attribute

stream = field(default=False) class-attribute instance-attribute

__init__(name, node_type, func=None, sources=list(), targets=list(), stream=False)