mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-09-26 19:45:00 +02:00
docs: add Command/GraphCommand docs
This commit is contained in:
@@ -86,7 +86,18 @@ def _get_node_name(node: RunnableLike) -> str:
|
||||
|
||||
@dataclasses.dataclass(**_DC_KWARGS)
|
||||
class GraphCommand(Generic[N], Command[N]):
|
||||
"""One or more commands to update a StateGraph's state and go to, or send messages to nodes."""
|
||||
"""One or more commands to update a StateGraph's state and go to, or send messages to nodes.
|
||||
|
||||
Args:
|
||||
goto: name of the node to navigate to next.
|
||||
If not specified, the graph will halt after executing the current superstep.
|
||||
graph: graph to send the command to. Supported values are:
|
||||
- None: the current graph (default)
|
||||
- GraphCommand.PARENT: closest parent graph
|
||||
update: state update to apply to the graph's state at the current superstep.
|
||||
send: list of `Send` objects to send to other nodes.
|
||||
resume: value to resume execution with. Will be used when `interrupt()` is called.
|
||||
"""
|
||||
|
||||
goto: Union[str, Sequence[str]] = ()
|
||||
|
||||
|
||||
@@ -239,7 +239,16 @@ N = TypeVar("N", bound=Hashable)
|
||||
|
||||
@dataclasses.dataclass(**_DC_KWARGS)
|
||||
class Command(Generic[N]):
|
||||
"""One or more commands to update the graph's state and send messages to nodes."""
|
||||
"""One or more commands to update the graph's state and send messages to nodes.
|
||||
|
||||
Args:
|
||||
graph: graph to send the command to. Supported values are:
|
||||
- None: the current graph (default)
|
||||
- GraphCommand.PARENT: closest parent graph
|
||||
update: state update to apply to the graph's state at the current superstep.
|
||||
send: list of `Send` objects to send to other nodes.
|
||||
resume: value to resume execution with. Will be used when `interrupt()` is called.
|
||||
"""
|
||||
|
||||
graph: Optional[str] = None
|
||||
update: Optional[dict[str, Any]] = None
|
||||
|
||||
Reference in New Issue
Block a user