style: update docstrings to reference StateGraph (#6308)

nit
This commit is contained in:
Mason Daugherty
2025-11-07 07:47:29 -05:00
committed by GitHub
parent 52d66df92c
commit 0f83d9fafe
2 changed files with 12 additions and 12 deletions
+10 -10
View File
@@ -289,7 +289,7 @@ class StateGraph(Generic[StateT, ContextT, InputT, OutputT]):
destinations: dict[str, str] | tuple[str, ...] | None = None,
**kwargs: Unpack[DeprecatedKwargs],
) -> Self:
"""Add a new node to the state graph, input schema is inferred as the state schema.
"""Add a new node to the `StateGraph`, input schema is inferred as the state schema.
Will take the name of the function/runnable as the node name.
"""
...
@@ -307,7 +307,7 @@ class StateGraph(Generic[StateT, ContextT, InputT, OutputT]):
destinations: dict[str, str] | tuple[str, ...] | None = None,
**kwargs: Unpack[DeprecatedKwargs],
) -> Self:
"""Add a new node to the state graph, input schema is specified.
"""Add a new node to the `StateGraph`, input schema is specified.
Will take the name of the function/runnable as the node name.
"""
...
@@ -326,7 +326,7 @@ class StateGraph(Generic[StateT, ContextT, InputT, OutputT]):
destinations: dict[str, str] | tuple[str, ...] | None = None,
**kwargs: Unpack[DeprecatedKwargs],
) -> Self:
"""Add a new node to the state graph, input schema is inferred as the state schema."""
"""Add a new node to the `StateGraph`, input schema is inferred as the state schema."""
...
@overload
@@ -343,7 +343,7 @@ class StateGraph(Generic[StateT, ContextT, InputT, OutputT]):
destinations: dict[str, str] | tuple[str, ...] | None = None,
**kwargs: Unpack[DeprecatedKwargs],
) -> Self:
"""Add a new node to the state graph, input schema is specified."""
"""Add a new node to the `StateGraph`, input schema is specified."""
...
def add_node(
@@ -359,7 +359,7 @@ class StateGraph(Generic[StateT, ContextT, InputT, OutputT]):
destinations: dict[str, str] | tuple[str, ...] | None = None,
**kwargs: Unpack[DeprecatedKwargs],
) -> Self:
"""Add a new node to the state graph.
"""Add a new node to the `StateGraph`.
Args:
node: The function or runnable this node will run.
@@ -416,7 +416,7 @@ class StateGraph(Generic[StateT, ContextT, InputT, OutputT]):
```
Returns:
Self: The instance of the state graph, allowing for method chaining.
Self: The instance of the `StateGraph`, allowing for method chaining.
"""
if (retry := kwargs.get("retry", MISSING)) is not MISSING:
warnings.warn(
@@ -571,7 +571,7 @@ class StateGraph(Generic[StateT, ContextT, InputT, OutputT]):
ValueError: If the start key is `'END'` or if the start key or end key is not present in the graph.
Returns:
Self: The instance of the state graph, allowing for method chaining.
Self: The instance of the `StateGraph`, allowing for method chaining.
"""
if self.compiled:
logger.warning(
@@ -676,7 +676,7 @@ class StateGraph(Generic[StateT, ContextT, InputT, OutputT]):
ValueError: If the sequence contains duplicate node names.
Returns:
Self: The instance of the state graph, allowing for method chaining.
Self: The instance of the `StateGraph`, allowing for method chaining.
"""
if len(nodes) < 1:
raise ValueError("Sequence requires at least one node.")
@@ -809,7 +809,7 @@ class StateGraph(Generic[StateT, ContextT, InputT, OutputT]):
debug: bool = False,
name: str | None = None,
) -> CompiledStateGraph[StateT, ContextT, InputT, OutputT]:
"""Compiles the state graph into a `CompiledStateGraph` object.
"""Compiles the `StateGraph` into a `CompiledStateGraph` object.
The compiled graph implements the `Runnable` interface and can be invoked,
streamed, batched, and run asynchronously.
@@ -826,7 +826,7 @@ class StateGraph(Generic[StateT, ContextT, InputT, OutputT]):
name: The name to use for the compiled graph.
Returns:
CompiledStateGraph: The compiled state graph.
CompiledStateGraph: The compiled `StateGraph`.
"""
# assign default values
interrupt_before = interrupt_before or []
+2 -2
View File
@@ -31,13 +31,13 @@ ContextT_contra = TypeVar(
)
InputT = TypeVar("InputT", bound=StateLike, default=StateT)
"""Type variable used to represent the input to a state graph.
"""Type variable used to represent the input to a `StateGraph`.
Defaults to `StateT`.
"""
OutputT = TypeVar("OutputT", bound=StateLike, default=StateT)
"""Type variable used to represent the output of a state graph.
"""Type variable used to represent the output of a `StateGraph`.
Defaults to `StateT`.
"""