Skip to content

Commit 0f83d9f

Browse files
authored
style: update docstrings to reference StateGraph (#6308)
nit
1 parent 52d66df commit 0f83d9f

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

libs/langgraph/langgraph/graph/state.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ def add_node(
289289
destinations: dict[str, str] | tuple[str, ...] | None = None,
290290
**kwargs: Unpack[DeprecatedKwargs],
291291
) -> Self:
292-
"""Add a new node to the state graph, input schema is inferred as the state schema.
292+
"""Add a new node to the `StateGraph`, input schema is inferred as the state schema.
293293
Will take the name of the function/runnable as the node name.
294294
"""
295295
...
@@ -307,7 +307,7 @@ def add_node(
307307
destinations: dict[str, str] | tuple[str, ...] | None = None,
308308
**kwargs: Unpack[DeprecatedKwargs],
309309
) -> Self:
310-
"""Add a new node to the state graph, input schema is specified.
310+
"""Add a new node to the `StateGraph`, input schema is specified.
311311
Will take the name of the function/runnable as the node name.
312312
"""
313313
...
@@ -326,7 +326,7 @@ def add_node(
326326
destinations: dict[str, str] | tuple[str, ...] | None = None,
327327
**kwargs: Unpack[DeprecatedKwargs],
328328
) -> Self:
329-
"""Add a new node to the state graph, input schema is inferred as the state schema."""
329+
"""Add a new node to the `StateGraph`, input schema is inferred as the state schema."""
330330
...
331331

332332
@overload
@@ -343,7 +343,7 @@ def add_node(
343343
destinations: dict[str, str] | tuple[str, ...] | None = None,
344344
**kwargs: Unpack[DeprecatedKwargs],
345345
) -> Self:
346-
"""Add a new node to the state graph, input schema is specified."""
346+
"""Add a new node to the `StateGraph`, input schema is specified."""
347347
...
348348

349349
def add_node(
@@ -359,7 +359,7 @@ def add_node(
359359
destinations: dict[str, str] | tuple[str, ...] | None = None,
360360
**kwargs: Unpack[DeprecatedKwargs],
361361
) -> Self:
362-
"""Add a new node to the state graph.
362+
"""Add a new node to the `StateGraph`.
363363
364364
Args:
365365
node: The function or runnable this node will run.
@@ -416,7 +416,7 @@ def my_node(state: State, config: RunnableConfig) -> State:
416416
```
417417
418418
Returns:
419-
Self: The instance of the state graph, allowing for method chaining.
419+
Self: The instance of the `StateGraph`, allowing for method chaining.
420420
"""
421421
if (retry := kwargs.get("retry", MISSING)) is not MISSING:
422422
warnings.warn(
@@ -571,7 +571,7 @@ def add_edge(self, start_key: str | list[str], end_key: str) -> Self:
571571
ValueError: If the start key is `'END'` or if the start key or end key is not present in the graph.
572572
573573
Returns:
574-
Self: The instance of the state graph, allowing for method chaining.
574+
Self: The instance of the `StateGraph`, allowing for method chaining.
575575
"""
576576
if self.compiled:
577577
logger.warning(
@@ -676,7 +676,7 @@ def add_sequence(
676676
ValueError: If the sequence contains duplicate node names.
677677
678678
Returns:
679-
Self: The instance of the state graph, allowing for method chaining.
679+
Self: The instance of the `StateGraph`, allowing for method chaining.
680680
"""
681681
if len(nodes) < 1:
682682
raise ValueError("Sequence requires at least one node.")
@@ -809,7 +809,7 @@ def compile(
809809
debug: bool = False,
810810
name: str | None = None,
811811
) -> CompiledStateGraph[StateT, ContextT, InputT, OutputT]:
812-
"""Compiles the state graph into a `CompiledStateGraph` object.
812+
"""Compiles the `StateGraph` into a `CompiledStateGraph` object.
813813
814814
The compiled graph implements the `Runnable` interface and can be invoked,
815815
streamed, batched, and run asynchronously.
@@ -826,7 +826,7 @@ def compile(
826826
name: The name to use for the compiled graph.
827827
828828
Returns:
829-
CompiledStateGraph: The compiled state graph.
829+
CompiledStateGraph: The compiled `StateGraph`.
830830
"""
831831
# assign default values
832832
interrupt_before = interrupt_before or []

libs/langgraph/langgraph/typing.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@
3131
)
3232

3333
InputT = TypeVar("InputT", bound=StateLike, default=StateT)
34-
"""Type variable used to represent the input to a state graph.
34+
"""Type variable used to represent the input to a `StateGraph`.
3535
3636
Defaults to `StateT`.
3737
"""
3838

3939
OutputT = TypeVar("OutputT", bound=StateLike, default=StateT)
40-
"""Type variable used to represent the output of a state graph.
40+
"""Type variable used to represent the output of a `StateGraph`.
4141
4242
Defaults to `StateT`.
4343
"""

0 commit comments

Comments
 (0)