teff.graph.edge¶
teff.graph.edge
¶
Graph edge model and hook protocol.
Classes:
| Name | Description |
|---|---|
Edge |
A directed edge between two nodes with an optional condition. |
Attributes:
| Name | Type | Description |
|---|---|---|
Hook |
Signature for observability hooks: |
Hook
module-attribute
¶
Hook = Callable[..., Any]
Signature for observability hooks: (node_id, node, state).
Hooks may be synchronous or asynchronous — async hooks are awaited by the
executor. on_node_end additionally receives the result dict and
on_node_error additionally receives the exception.
Edge
dataclass
¶
A directed edge between two nodes with an optional condition.
Attributes:
| Name | Type | Description |
|---|---|---|
source_id |
str
|
ID of the source node. |
target_id |
str
|
ID of the target node. |
condition |
str | Callable[[dict], bool] | None
|
Expression |
Source code in teff/graph/edge.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | |