NodeProtocol Objects
Graph Objects
get_state
set_state
state- The new state to set for the graph.
update_state
values- The new values to update the graph state with.
reset_state
add_node
node- The node to add to the graph.
Exception- If a node with the same name already exists in the graph.
add_edge
source- The source node or its name.destination- The destination node or its name.
add_router
choice output of the router node.
Arguments:
sources- The list of source nodes for the router.router- The router node.destinations- The list of destination nodes for the router.
compile
- exactly one start node present (or Graph.start_node set)
- at least one end node present
- all edges reference known nodes
- all nodes reachable from the start (optional) no cycles when strict=True Returns self on success; raises GraphCompileError otherwise.
execute_many
inputs(Iterable[dict]): An iterable of input dicts to feed into the graph.concurrency(int): Maximum number of graph executions to run at once.state(Optional[Any]): Optional shared state to pass to each execution. If you want isolated state per execution, pass None and the graph’s normal semantics will apply.
list[Any]: The list of results in the same order as inputs.
get_callback
Callback: A new instance of the callback class.
set_callback
get_callback method and used
as the default callback when no callback is passed to the execute method.
Arguments:
callback_class(type[Callback]): The callback class to use as the default callback.
add_parallel
source- The source node for the parallel branches.destinations- The list of destination nodes for the parallel branches.
add_join
sources- The list of source nodes for the join.destination- The destination node for the join.
visualize
save_path.
