mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-08-21 07:02:25 +02:00
@@ -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 []
|
||||
|
||||
@@ -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`.
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user