mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-10-01 22:15:11 +02:00
Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4fdd7aeafe | ||
|
|
78910dade0 | ||
|
|
33fbd1bb9c | ||
|
|
846d5998f7 | ||
|
|
d45f52ab0c |
@@ -60,23 +60,28 @@ class Checkpoint(TypedDict):
|
|||||||
"""State snapshot at a given point in time."""
|
"""State snapshot at a given point in time."""
|
||||||
|
|
||||||
v: int
|
v: int
|
||||||
"""The version of the checkpoint format. Currently 1."""
|
"""The version of the checkpoint format. Currently `1`."""
|
||||||
id: str
|
id: str
|
||||||
"""The ID of the checkpoint. This is both unique and monotonically
|
"""The ID of the checkpoint.
|
||||||
increasing, so can be used for sorting checkpoints from first to last."""
|
|
||||||
|
This is both unique and monotonically increasing, so can be used for sorting
|
||||||
|
checkpoints from first to last."""
|
||||||
ts: str
|
ts: str
|
||||||
"""The timestamp of the checkpoint in ISO 8601 format."""
|
"""The timestamp of the checkpoint in ISO 8601 format."""
|
||||||
channel_values: dict[str, Any]
|
channel_values: dict[str, Any]
|
||||||
"""The values of the channels at the time of the checkpoint.
|
"""The values of the channels at the time of the checkpoint.
|
||||||
|
|
||||||
Mapping from channel name to deserialized channel snapshot value.
|
Mapping from channel name to deserialized channel snapshot value.
|
||||||
"""
|
"""
|
||||||
channel_versions: ChannelVersions
|
channel_versions: ChannelVersions
|
||||||
"""The versions of the channels at the time of the checkpoint.
|
"""The versions of the channels at the time of the checkpoint.
|
||||||
|
|
||||||
The keys are channel names and the values are monotonically increasing
|
The keys are channel names and the values are monotonically increasing
|
||||||
version strings for each channel.
|
version strings for each channel.
|
||||||
"""
|
"""
|
||||||
versions_seen: dict[str, ChannelVersions]
|
versions_seen: dict[str, ChannelVersions]
|
||||||
"""Map from node ID to map from channel name to version seen.
|
"""Map from node ID to map from channel name to version seen.
|
||||||
|
|
||||||
This keeps track of the versions of the channels that each node has seen.
|
This keeps track of the versions of the channels that each node has seen.
|
||||||
Used to determine which nodes to execute next.
|
Used to determine which nodes to execute next.
|
||||||
"""
|
"""
|
||||||
@@ -352,8 +357,9 @@ class BaseCheckpointSaver(Generic[V]):
|
|||||||
def get_next_version(self, current: V | None, channel: None) -> V:
|
def get_next_version(self, current: V | None, channel: None) -> V:
|
||||||
"""Generate the next version ID for a channel.
|
"""Generate the next version ID for a channel.
|
||||||
|
|
||||||
Default is to use integer versions, incrementing by `1`. If you override, you can use `str`/`int`/`float`
|
Default is to use integer versions, incrementing by `1`.
|
||||||
versions, as long as they are monotonically increasing.
|
|
||||||
|
If you override, you can use `str`/`int`/`float` versions, as long as they are monotonically increasing.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
current: The current version identifier (`int`, `float`, or `str`).
|
current: The current version identifier (`int`, `float`, or `str`).
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ class InMemorySaver(
|
|||||||
):
|
):
|
||||||
"""An in-memory checkpoint saver.
|
"""An in-memory checkpoint saver.
|
||||||
|
|
||||||
This checkpoint saver stores checkpoints in memory using a defaultdict.
|
This checkpoint saver stores checkpoints in memory using a `defaultdict`.
|
||||||
|
|
||||||
Note:
|
Note:
|
||||||
Only use `InMemorySaver` for debugging or testing purposes.
|
Only use `InMemorySaver` for debugging or testing purposes.
|
||||||
@@ -44,22 +44,23 @@ class InMemorySaver(
|
|||||||
Args:
|
Args:
|
||||||
serde: The serializer to use for serializing and deserializing checkpoints.
|
serde: The serializer to use for serializing and deserializing checkpoints.
|
||||||
|
|
||||||
Examples:
|
Example:
|
||||||
|
```python
|
||||||
|
import asyncio
|
||||||
|
|
||||||
import asyncio
|
from langgraph.checkpoint.memory import InMemorySaver
|
||||||
|
from langgraph.graph import StateGraph
|
||||||
|
|
||||||
from langgraph.checkpoint.memory import InMemorySaver
|
builder = StateGraph(int)
|
||||||
from langgraph.graph import StateGraph
|
builder.add_node("add_one", lambda x: x + 1)
|
||||||
|
builder.set_entry_point("add_one")
|
||||||
|
builder.set_finish_point("add_one")
|
||||||
|
|
||||||
builder = StateGraph(int)
|
memory = InMemorySaver()
|
||||||
builder.add_node("add_one", lambda x: x + 1)
|
graph = builder.compile(checkpointer=memory)
|
||||||
builder.set_entry_point("add_one")
|
coro = graph.ainvoke(1, {"configurable": {"thread_id": "thread-1"}})
|
||||||
builder.set_finish_point("add_one")
|
asyncio.run(coro) # Output: 2
|
||||||
|
```
|
||||||
memory = InMemorySaver()
|
|
||||||
graph = builder.compile(checkpointer=memory)
|
|
||||||
coro = graph.ainvoke(1, {"configurable": {"thread_id": "thread-1"}})
|
|
||||||
asyncio.run(coro) # Output: 2
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# thread ID -> checkpoint NS -> checkpoint ID -> checkpoint mapping
|
# thread ID -> checkpoint NS -> checkpoint ID -> checkpoint mapping
|
||||||
|
|||||||
@@ -52,12 +52,13 @@ def maybe_add_typed_methods(
|
|||||||
|
|
||||||
class CipherProtocol(Protocol):
|
class CipherProtocol(Protocol):
|
||||||
"""Protocol for encryption and decryption of data.
|
"""Protocol for encryption and decryption of data.
|
||||||
|
|
||||||
- `encrypt`: Encrypt plaintext.
|
- `encrypt`: Encrypt plaintext.
|
||||||
- `decrypt`: Decrypt ciphertext.
|
- `decrypt`: Decrypt ciphertext.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def encrypt(self, plaintext: bytes) -> tuple[str, bytes]:
|
def encrypt(self, plaintext: bytes) -> tuple[str, bytes]:
|
||||||
"""Encrypt plaintext. Returns a tuple (cipher name, ciphertext)."""
|
"""Encrypt plaintext. Returns a tuple `(cipher name, ciphertext)`."""
|
||||||
...
|
...
|
||||||
|
|
||||||
def decrypt(self, ciphername: str, ciphertext: bytes) -> bytes:
|
def decrypt(self, ciphername: str, ciphertext: bytes) -> bytes:
|
||||||
|
|||||||
@@ -41,10 +41,12 @@ logger = logging.getLogger(__name__)
|
|||||||
class JsonPlusSerializer(SerializerProtocol):
|
class JsonPlusSerializer(SerializerProtocol):
|
||||||
"""Serializer that uses ormsgpack, with optional fallbacks.
|
"""Serializer that uses ormsgpack, with optional fallbacks.
|
||||||
|
|
||||||
Security note: this serializer is intended for use within the BaseCheckpointSaver
|
!!! warning
|
||||||
class and called within the Pregel loop. It should not be used on untrusted
|
|
||||||
python objects. If an attacker can write directly to your checkpoint database,
|
Security note: This serializer is intended for use within the `BaseCheckpointSaver`
|
||||||
they may be able to trigger code execution when data is deserialized.
|
class and called within the Pregel loop. It should not be used on untrusted
|
||||||
|
python objects. If an attacker can write directly to your checkpoint database,
|
||||||
|
they may be able to trigger code execution when data is deserialized.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
|
|||||||
@@ -39,14 +39,19 @@ class BaseChannel(Generic[Value, Update, Checkpoint], ABC):
|
|||||||
|
|
||||||
def copy(self) -> Self:
|
def copy(self) -> Self:
|
||||||
"""Return a copy of the channel.
|
"""Return a copy of the channel.
|
||||||
|
|
||||||
By default, delegates to `checkpoint()` and `from_checkpoint()`.
|
By default, delegates to `checkpoint()` and `from_checkpoint()`.
|
||||||
Subclasses can override this method with a more efficient implementation."""
|
|
||||||
|
Subclasses can override this method with a more efficient implementation.
|
||||||
|
"""
|
||||||
return self.from_checkpoint(self.checkpoint())
|
return self.from_checkpoint(self.checkpoint())
|
||||||
|
|
||||||
def checkpoint(self) -> Checkpoint | Any:
|
def checkpoint(self) -> Checkpoint | Any:
|
||||||
"""Return a serializable representation of the channel's current state.
|
"""Return a serializable representation of the channel's current state.
|
||||||
|
|
||||||
Raises `EmptyChannelError` if the channel is empty (never updated yet),
|
Raises `EmptyChannelError` if the channel is empty (never updated yet),
|
||||||
or doesn't support checkpoints."""
|
or doesn't support checkpoints.
|
||||||
|
"""
|
||||||
try:
|
try:
|
||||||
return self.get()
|
return self.get()
|
||||||
except EmptyChannelError:
|
except EmptyChannelError:
|
||||||
@@ -55,7 +60,9 @@ class BaseChannel(Generic[Value, Update, Checkpoint], ABC):
|
|||||||
@abstractmethod
|
@abstractmethod
|
||||||
def from_checkpoint(self, checkpoint: Checkpoint | Any) -> Self:
|
def from_checkpoint(self, checkpoint: Checkpoint | Any) -> Self:
|
||||||
"""Return a new identical channel, optionally initialized from a checkpoint.
|
"""Return a new identical channel, optionally initialized from a checkpoint.
|
||||||
If the checkpoint contains complex data structures, they should be copied."""
|
|
||||||
|
If the checkpoint contains complex data structures, they should be copied.
|
||||||
|
"""
|
||||||
|
|
||||||
# read methods
|
# read methods
|
||||||
|
|
||||||
@@ -67,6 +74,7 @@ class BaseChannel(Generic[Value, Update, Checkpoint], ABC):
|
|||||||
|
|
||||||
def is_available(self) -> bool:
|
def is_available(self) -> bool:
|
||||||
"""Return `True` if the channel is available (not empty), `False` otherwise.
|
"""Return `True` if the channel is available (not empty), `False` otherwise.
|
||||||
|
|
||||||
Subclasses should override this method to provide a more efficient
|
Subclasses should override this method to provide a more efficient
|
||||||
implementation than calling `get()` and catching `EmptyChannelError`.
|
implementation than calling `get()` and catching `EmptyChannelError`.
|
||||||
"""
|
"""
|
||||||
@@ -83,21 +91,29 @@ class BaseChannel(Generic[Value, Update, Checkpoint], ABC):
|
|||||||
"""Update the channel's value with the given sequence of updates.
|
"""Update the channel's value with the given sequence of updates.
|
||||||
The order of the updates in the sequence is arbitrary.
|
The order of the updates in the sequence is arbitrary.
|
||||||
This method is called by Pregel for all channels at the end of each step.
|
This method is called by Pregel for all channels at the end of each step.
|
||||||
|
|
||||||
If there are no updates, it is called with an empty sequence.
|
If there are no updates, it is called with an empty sequence.
|
||||||
|
|
||||||
Raises `InvalidUpdateError` if the sequence of updates is invalid.
|
Raises `InvalidUpdateError` if the sequence of updates is invalid.
|
||||||
|
|
||||||
Returns `True` if the channel was updated, `False` otherwise."""
|
Returns `True` if the channel was updated, `False` otherwise."""
|
||||||
|
|
||||||
def consume(self) -> bool:
|
def consume(self) -> bool:
|
||||||
"""Notify the channel that a subscribed task ran. By default, no-op.
|
"""Notify the channel that a subscribed task ran.
|
||||||
A channel can use this method to modify its state, preventing the value
|
|
||||||
from being consumed again.
|
By default, no-op.
|
||||||
|
|
||||||
|
A channel can use this method to modify its state, preventing the value from being consumed again.
|
||||||
|
|
||||||
Returns `True` if the channel was updated, `False` otherwise.
|
Returns `True` if the channel was updated, `False` otherwise.
|
||||||
"""
|
"""
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def finish(self) -> bool:
|
def finish(self) -> bool:
|
||||||
"""Notify the channel that the Pregel run is finishing. By default, no-op.
|
"""Notify the channel that the Pregel run is finishing.
|
||||||
|
|
||||||
|
By default, no-op.
|
||||||
|
|
||||||
A channel can use this method to modify its state, preventing finish.
|
A channel can use this method to modify its state, preventing finish.
|
||||||
|
|
||||||
Returns `True` if the channel was updated, `False` otherwise.
|
Returns `True` if the channel was updated, `False` otherwise.
|
||||||
|
|||||||
@@ -32,8 +32,8 @@ def get_config() -> RunnableConfig:
|
|||||||
def get_store() -> BaseStore:
|
def get_store() -> BaseStore:
|
||||||
"""Access LangGraph store from inside a graph node or entrypoint task at runtime.
|
"""Access LangGraph store from inside a graph node or entrypoint task at runtime.
|
||||||
|
|
||||||
Can be called from inside any [StateGraph][langgraph.graph.StateGraph] node or
|
Can be called from inside any [`StateGraph`][langgraph.graph.StateGraph] node or
|
||||||
functional API [task][langgraph.func.task], as long as the StateGraph or the [entrypoint][langgraph.func.entrypoint]
|
functional API [`task`][langgraph.func.task], as long as the `StateGraph` or the [`entrypoint`][langgraph.func.entrypoint]
|
||||||
was initialized with a store, e.g.:
|
was initialized with a store, e.g.:
|
||||||
|
|
||||||
```python
|
```python
|
||||||
@@ -53,10 +53,10 @@ def get_store() -> BaseStore:
|
|||||||
!!! warning "Async with Python < 3.11"
|
!!! warning "Async with Python < 3.11"
|
||||||
|
|
||||||
If you are using Python < 3.11 and are running LangGraph asynchronously,
|
If you are using Python < 3.11 and are running LangGraph asynchronously,
|
||||||
`get_store()` won't work since it uses [contextvar](https://docs.python.org/3/library/contextvars.html) propagation (only available in [Python >= 3.11](https://docs.python.org/3/library/asyncio-task.html#asyncio.create_task)).
|
`get_store()` won't work since it uses [`contextvar`](https://docs.python.org/3/library/contextvars.html) propagation (only available in [Python >= 3.11](https://docs.python.org/3/library/asyncio-task.html#asyncio.create_task)).
|
||||||
|
|
||||||
|
|
||||||
Example: Using with StateGraph
|
Example: Using with `StateGraph`
|
||||||
```python
|
```python
|
||||||
from typing_extensions import TypedDict
|
from typing_extensions import TypedDict
|
||||||
from langgraph.graph import StateGraph, START
|
from langgraph.graph import StateGraph, START
|
||||||
@@ -124,17 +124,17 @@ def get_store() -> BaseStore:
|
|||||||
|
|
||||||
|
|
||||||
def get_stream_writer() -> StreamWriter:
|
def get_stream_writer() -> StreamWriter:
|
||||||
"""Access LangGraph [StreamWriter][langgraph.types.StreamWriter] from inside a graph node or entrypoint task at runtime.
|
"""Access LangGraph [`StreamWriter`][langgraph.types.StreamWriter] from inside a graph node or entrypoint task at runtime.
|
||||||
|
|
||||||
Can be called from inside any [StateGraph][langgraph.graph.StateGraph] node or
|
Can be called from inside any [`StateGraph`][langgraph.graph.StateGraph] node or
|
||||||
functional API [task][langgraph.func.task].
|
functional API [`task`][langgraph.func.task].
|
||||||
|
|
||||||
!!! warning "Async with Python < 3.11"
|
!!! warning "Async with Python < 3.11"
|
||||||
|
|
||||||
If you are using Python < 3.11 and are running LangGraph asynchronously,
|
If you are using Python < 3.11 and are running LangGraph asynchronously,
|
||||||
`get_stream_writer()` won't work since it uses [contextvar](https://docs.python.org/3/library/contextvars.html) propagation (only available in [Python >= 3.11](https://docs.python.org/3/library/asyncio-task.html#asyncio.create_task)).
|
`get_stream_writer()` won't work since it uses [`contextvar`](https://docs.python.org/3/library/contextvars.html) propagation (only available in [Python >= 3.11](https://docs.python.org/3/library/asyncio-task.html#asyncio.create_task)).
|
||||||
|
|
||||||
Example: Using with StateGraph
|
Example: Using with `StateGraph`
|
||||||
```python
|
```python
|
||||||
from typing_extensions import TypedDict
|
from typing_extensions import TypedDict
|
||||||
from langgraph.graph import StateGraph, START
|
from langgraph.graph import StateGraph, START
|
||||||
|
|||||||
@@ -357,7 +357,7 @@ class entrypoint(Generic[ContextT]):
|
|||||||
my_workflow.invoke("hello", config)
|
my_workflow.invoke("hello", config)
|
||||||
```
|
```
|
||||||
|
|
||||||
Example: Using entrypoint.final to save a value
|
Example: Using `entrypoint.final` to save a value
|
||||||
The `entrypoint.final` object allows you to return a value while saving
|
The `entrypoint.final` object allows you to return a value while saving
|
||||||
a different value to the checkpoint. This value will be accessible
|
a different value to the checkpoint. This value will be accessible
|
||||||
in the next invocation of the entrypoint via the `previous` parameter, as
|
in the next invocation of the entrypoint via the `previous` parameter, as
|
||||||
|
|||||||
@@ -88,8 +88,8 @@ def add_messages(
|
|||||||
If a message in `right` has the same ID as a message in `left`, the
|
If a message in `right` has the same ID as a message in `left`, the
|
||||||
message from `right` will replace the message from `left`.
|
message from `right` will replace the message from `left`.
|
||||||
|
|
||||||
Example:
|
Example: Basic usage
|
||||||
```python title="Basic usage"
|
```python
|
||||||
from langchain_core.messages import AIMessage, HumanMessage
|
from langchain_core.messages import AIMessage, HumanMessage
|
||||||
|
|
||||||
msgs1 = [HumanMessage(content="Hello", id="1")]
|
msgs1 = [HumanMessage(content="Hello", id="1")]
|
||||||
@@ -98,14 +98,16 @@ def add_messages(
|
|||||||
# [HumanMessage(content='Hello', id='1'), AIMessage(content='Hi there!', id='2')]
|
# [HumanMessage(content='Hello', id='1'), AIMessage(content='Hi there!', id='2')]
|
||||||
```
|
```
|
||||||
|
|
||||||
```python title="Overwrite existing message"
|
Example: Overwrite existing message
|
||||||
|
```python
|
||||||
msgs1 = [HumanMessage(content="Hello", id="1")]
|
msgs1 = [HumanMessage(content="Hello", id="1")]
|
||||||
msgs2 = [HumanMessage(content="Hello again", id="1")]
|
msgs2 = [HumanMessage(content="Hello again", id="1")]
|
||||||
add_messages(msgs1, msgs2)
|
add_messages(msgs1, msgs2)
|
||||||
# [HumanMessage(content='Hello again', id='1')]
|
# [HumanMessage(content='Hello again', id='1')]
|
||||||
```
|
```
|
||||||
|
|
||||||
```python title="Use in a StateGraph"
|
Example: Use in a StateGraph
|
||||||
|
```python
|
||||||
from typing import Annotated
|
from typing import Annotated
|
||||||
from typing_extensions import TypedDict
|
from typing_extensions import TypedDict
|
||||||
from langgraph.graph import StateGraph
|
from langgraph.graph import StateGraph
|
||||||
@@ -124,7 +126,8 @@ def add_messages(
|
|||||||
# {'messages': [AIMessage(content='Hello', id=...)]}
|
# {'messages': [AIMessage(content='Hello', id=...)]}
|
||||||
```
|
```
|
||||||
|
|
||||||
```python title="Use OpenAI message format"
|
Example: Use OpenAI message format
|
||||||
|
```python
|
||||||
from typing import Annotated
|
from typing import Annotated
|
||||||
from typing_extensions import TypedDict
|
from typing_extensions import TypedDict
|
||||||
from langgraph.graph import StateGraph, add_messages
|
from langgraph.graph import StateGraph, add_messages
|
||||||
|
|||||||
@@ -127,6 +127,7 @@ class StateGraph(Generic[StateT, ContextT, InputT, OutputT]):
|
|||||||
Args:
|
Args:
|
||||||
state_schema: The schema class that defines the state.
|
state_schema: The schema class that defines the state.
|
||||||
context_schema: The schema class that defines the runtime context.
|
context_schema: The schema class that defines the runtime context.
|
||||||
|
|
||||||
Use this to expose immutable context data to your nodes, like `user_id`, `db_conn`, etc.
|
Use this to expose immutable context data to your nodes, like `user_id`, `db_conn`, etc.
|
||||||
input_schema: The schema class that defines the input to the graph.
|
input_schema: The schema class that defines the input to the graph.
|
||||||
output_schema: The schema class that defines the output from the graph.
|
output_schema: The schema class that defines the output from the graph.
|
||||||
@@ -371,18 +372,23 @@ class StateGraph(Generic[StateT, ContextT, InputT, OutputT]):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
node: The function or runnable this node will run.
|
node: The function or runnable this node will run.
|
||||||
|
|
||||||
If a string is provided, it will be used as the node name, and action will be used as the function or runnable.
|
If a string is provided, it will be used as the node name, and action will be used as the function or runnable.
|
||||||
action: The action associated with the node.
|
action: The action associated with the node.
|
||||||
Will be used as the node function or runnable if `node` is a string (node name).
|
Will be used as the node function or runnable if `node` is a string (node name).
|
||||||
defer: Whether to defer the execution of the node until the run is about to end.
|
defer: Whether to defer the execution of the node until the run is about to end.
|
||||||
metadata: The metadata associated with the node.
|
metadata: The metadata associated with the node.
|
||||||
input_schema: The input schema for the node. (default: the graph's state schema)
|
input_schema: The input schema for the node. (Default: the graph's state schema)
|
||||||
retry_policy: The retry policy for the node.
|
retry_policy: The retry policy for the node.
|
||||||
|
|
||||||
If a sequence is provided, the first matching policy will be applied.
|
If a sequence is provided, the first matching policy will be applied.
|
||||||
cache_policy: The cache policy for the node.
|
cache_policy: The cache policy for the node.
|
||||||
destinations: Destinations that indicate where a node can route to.
|
destinations: Destinations that indicate where a node can route to.
|
||||||
This is useful for edgeless graphs with nodes that return `Command` objects.
|
|
||||||
|
Useful for edgeless graphs with nodes that return `Command` objects.
|
||||||
|
|
||||||
If a `dict` is provided, the keys will be used as the target node names and the values will be used as the labels for the edges.
|
If a `dict` is provided, the keys will be used as the target node names and the values will be used as the labels for the edges.
|
||||||
|
|
||||||
If a `tuple` is provided, the values will be used as the target node names.
|
If a `tuple` is provided, the values will be used as the target node names.
|
||||||
|
|
||||||
!!! note
|
!!! note
|
||||||
@@ -631,11 +637,14 @@ class StateGraph(Generic[StateT, ContextT, InputT, OutputT]):
|
|||||||
Args:
|
Args:
|
||||||
source: The starting node. This conditional edge will run when
|
source: The starting node. This conditional edge will run when
|
||||||
exiting this node.
|
exiting this node.
|
||||||
path: The callable that determines the next
|
path: The callable that determines the next node or nodes.
|
||||||
node or nodes. If not specifying `path_map` it should return one or
|
|
||||||
more nodes. If it returns `'END'`, the graph will stop execution.
|
If not specifying `path_map` it should return one or more nodes.
|
||||||
path_map: Optional mapping of paths to node
|
|
||||||
names. If omitted the paths returned by `path` should be node names.
|
If it returns `'END'`, the graph will stop execution.
|
||||||
|
path_map: Optional mapping of paths to node names.
|
||||||
|
|
||||||
|
If omitted the paths returned by `path` should be node names.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Self: The instance of the graph, allowing for method chaining.
|
Self: The instance of the graph, allowing for method chaining.
|
||||||
@@ -676,7 +685,9 @@ class StateGraph(Generic[StateT, ContextT, InputT, OutputT]):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
nodes: A sequence of `StateNode` (callables that accept a `state` arg) or `(name, StateNode)` tuples.
|
nodes: A sequence of `StateNode` (callables that accept a `state` arg) or `(name, StateNode)` tuples.
|
||||||
|
|
||||||
If no names are provided, the name will be inferred from the node object (e.g. a `Runnable` or a `Callable` name).
|
If no names are provided, the name will be inferred from the node object (e.g. a `Runnable` or a `Callable` name).
|
||||||
|
|
||||||
Each node will be executed in the order provided.
|
Each node will be executed in the order provided.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
@@ -733,11 +744,14 @@ class StateGraph(Generic[StateT, ContextT, InputT, OutputT]):
|
|||||||
"""Sets a conditional entry point in the graph.
|
"""Sets a conditional entry point in the graph.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
path: The callable that determines the next
|
path: The callable that determines the next node or nodes.
|
||||||
node or nodes. If not specifying `path_map` it should return one or
|
|
||||||
more nodes. If it returns END, the graph will stop execution.
|
If not specifying `path_map` it should return one or more nodes.
|
||||||
path_map: Optional mapping of paths to node
|
|
||||||
names. If omitted the paths returned by `path` should be node names.
|
If it returns END, the graph will stop execution.
|
||||||
|
path_map: Optional mapping of paths to node names.
|
||||||
|
|
||||||
|
If omitted the paths returned by `path` should be node names.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Self: The instance of the graph, allowing for method chaining.
|
Self: The instance of the graph, allowing for method chaining.
|
||||||
@@ -824,9 +838,12 @@ class StateGraph(Generic[StateT, ContextT, InputT, OutputT]):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
checkpointer: A checkpoint saver object or flag.
|
checkpointer: A checkpoint saver object or flag.
|
||||||
|
|
||||||
If provided, this `Checkpointer` serves as a fully versioned "short-term memory" for the graph,
|
If provided, this `Checkpointer` serves as a fully versioned "short-term memory" for the graph,
|
||||||
allowing it to be paused, resumed, and replayed from any point.
|
allowing it to be paused, resumed, and replayed from any point.
|
||||||
|
|
||||||
If `None`, it may inherit the parent graph's checkpointer when used as a subgraph.
|
If `None`, it may inherit the parent graph's checkpointer when used as a subgraph.
|
||||||
|
|
||||||
If `False`, it will not use or inherit any checkpointer.
|
If `False`, it will not use or inherit any checkpointer.
|
||||||
interrupt_before: An optional list of node names to interrupt before.
|
interrupt_before: An optional list of node names to interrupt before.
|
||||||
interrupt_after: An optional list of node names to interrupt after.
|
interrupt_after: An optional list of node names to interrupt after.
|
||||||
|
|||||||
@@ -210,8 +210,10 @@ class NodeBuilder:
|
|||||||
*channels: str,
|
*channels: str,
|
||||||
read: bool = True,
|
read: bool = True,
|
||||||
) -> Self:
|
) -> Self:
|
||||||
"""Add channels to subscribe to. Node will be invoked when any of these
|
"""Add channels to subscribe to.
|
||||||
channels are updated, with a dict of the channel values as input.
|
|
||||||
|
Node will be invoked when any of these channels are updated, with a dict of the
|
||||||
|
channel values as input.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
channels: Channel name(s) to subscribe to
|
channels: Channel name(s) to subscribe to
|
||||||
@@ -270,8 +272,8 @@ class NodeBuilder:
|
|||||||
"""Add channel writes.
|
"""Add channel writes.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
*channels: Channel names to write to
|
*channels: Channel names to write to.
|
||||||
**kwargs: Channel name and value mappings
|
**kwargs: Channel name and value mappings.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Self for chaining
|
Self for chaining
|
||||||
@@ -375,12 +377,12 @@ class Pregel(
|
|||||||
### Advanced channels: Context and BinaryOperatorAggregate
|
### Advanced channels: Context and BinaryOperatorAggregate
|
||||||
|
|
||||||
- `Context`: exposes the value of a context manager, managing its lifecycle.
|
- `Context`: exposes the value of a context manager, managing its lifecycle.
|
||||||
Useful for accessing external resources that require setup and/or teardown. eg.
|
Useful for accessing external resources that require setup and/or teardown. e.g.
|
||||||
`client = Context(httpx.Client)`
|
`client = Context(httpx.Client)`
|
||||||
- `BinaryOperatorAggregate`: stores a persistent value, updated by applying
|
- `BinaryOperatorAggregate`: stores a persistent value, updated by applying
|
||||||
a binary operator to the current value and each update
|
a binary operator to the current value and each update
|
||||||
sent to the channel, useful for computing aggregates over multiple steps. eg.
|
sent to the channel, useful for computing aggregates over multiple steps. e.g.
|
||||||
`total = BinaryOperatorAggregate(int, operator.add)`
|
`total = BinaryOperatorAggregate(int, operator.add)`
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
@@ -495,7 +497,7 @@ class Pregel(
|
|||||||
{"c": ["foofoo", "foofoofoofoo"]}
|
{"c": ["foofoo", "foofoofoofoo"]}
|
||||||
```
|
```
|
||||||
|
|
||||||
Example: Using a BinaryOperatorAggregate channel
|
Example: Using a `BinaryOperatorAggregate` channel
|
||||||
```python
|
```python
|
||||||
from langgraph.channels import EphemeralValue, BinaryOperatorAggregate
|
from langgraph.channels import EphemeralValue, BinaryOperatorAggregate
|
||||||
from langgraph.pregel import Pregel, NodeBuilder
|
from langgraph.pregel import Pregel, NodeBuilder
|
||||||
@@ -541,8 +543,9 @@ class Pregel(
|
|||||||
|
|
||||||
Example: Introducing a cycle
|
Example: Introducing a cycle
|
||||||
This example demonstrates how to introduce a cycle in the graph, by having
|
This example demonstrates how to introduce a cycle in the graph, by having
|
||||||
a chain write to a channel it subscribes to. Execution will continue
|
a chain write to a channel it subscribes to.
|
||||||
until a None value is written to the channel.
|
|
||||||
|
Execution will continue until a `None` value is written to the channel.
|
||||||
|
|
||||||
```python
|
```python
|
||||||
from langgraph.channels import EphemeralValue
|
from langgraph.channels import EphemeralValue
|
||||||
@@ -1426,7 +1429,8 @@ class Pregel(
|
|||||||
Args:
|
Args:
|
||||||
config: The config to apply the updates to.
|
config: The config to apply the updates to.
|
||||||
supersteps: A list of supersteps, each including a list of updates to apply sequentially to a graph state.
|
supersteps: A list of supersteps, each including a list of updates to apply sequentially to a graph state.
|
||||||
Each update is a tuple of the form `(values, as_node, task_id)` where `task_id` is optional.
|
|
||||||
|
Each update is a tuple of the form `(values, as_node, task_id)` where `task_id` is optional.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
ValueError: If no checkpointer is set or no updates are provided.
|
ValueError: If no checkpointer is set or no updates are provided.
|
||||||
@@ -1869,7 +1873,8 @@ class Pregel(
|
|||||||
Args:
|
Args:
|
||||||
config: The config to apply the updates to.
|
config: The config to apply the updates to.
|
||||||
supersteps: A list of supersteps, each including a list of updates to apply sequentially to a graph state.
|
supersteps: A list of supersteps, each including a list of updates to apply sequentially to a graph state.
|
||||||
Each update is a tuple of the form `(values, as_node, task_id)` where `task_id` is optional.
|
|
||||||
|
Each update is a tuple of the form `(values, as_node, task_id)` where `task_id` is optional.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
ValueError: If no checkpointer is set or no updates are provided.
|
ValueError: If no checkpointer is set or no updates are provided.
|
||||||
@@ -2420,6 +2425,7 @@ class Pregel(
|
|||||||
context: The static context to use for the run.
|
context: The static context to use for the run.
|
||||||
!!! version-added "Added in version 0.6.0"
|
!!! version-added "Added in version 0.6.0"
|
||||||
stream_mode: The mode to stream output, defaults to `self.stream_mode`.
|
stream_mode: The mode to stream output, defaults to `self.stream_mode`.
|
||||||
|
|
||||||
Options are:
|
Options are:
|
||||||
|
|
||||||
- `"values"`: Emit all values in the state after each step, including interrupts.
|
- `"values"`: Emit all values in the state after each step, including interrupts.
|
||||||
@@ -2428,7 +2434,7 @@ class Pregel(
|
|||||||
If multiple updates are made in the same step (e.g. multiple nodes are run) then those updates are emitted separately.
|
If multiple updates are made in the same step (e.g. multiple nodes are run) then those updates are emitted separately.
|
||||||
- `"custom"`: Emit custom data from inside nodes or tasks using `StreamWriter`.
|
- `"custom"`: Emit custom data from inside nodes or tasks using `StreamWriter`.
|
||||||
- `"messages"`: Emit LLM messages token-by-token together with metadata for any LLM invocations inside nodes or tasks.
|
- `"messages"`: Emit LLM messages token-by-token together with metadata for any LLM invocations inside nodes or tasks.
|
||||||
Will be emitted as 2-tuples `(LLM token, metadata)`.
|
- Will be emitted as 2-tuples `(LLM token, metadata)`.
|
||||||
- `"checkpoints"`: Emit an event when a checkpoint is created, in the same format as returned by `get_state()`.
|
- `"checkpoints"`: Emit an event when a checkpoint is created, in the same format as returned by `get_state()`.
|
||||||
- `"tasks"`: Emit events when tasks start and finish, including their results and errors.
|
- `"tasks"`: Emit events when tasks start and finish, including their results and errors.
|
||||||
- `"debug"`: Emit debug events with as much information as possible for each step.
|
- `"debug"`: Emit debug events with as much information as possible for each step.
|
||||||
@@ -2437,17 +2443,21 @@ class Pregel(
|
|||||||
The streamed outputs will be tuples of `(mode, data)`.
|
The streamed outputs will be tuples of `(mode, data)`.
|
||||||
|
|
||||||
See [LangGraph streaming guide](https://docs.langchain.com/oss/python/langgraph/streaming) for more details.
|
See [LangGraph streaming guide](https://docs.langchain.com/oss/python/langgraph/streaming) for more details.
|
||||||
print_mode: Accepts the same values as `stream_mode`, but only prints the output to the console, for debugging purposes. Does not affect the output of the graph in any way.
|
print_mode: Accepts the same values as `stream_mode`, but only prints the output to the console, for debugging purposes.
|
||||||
|
|
||||||
|
Does not affect the output of the graph in any way.
|
||||||
output_keys: The keys to stream, defaults to all non-context channels.
|
output_keys: The keys to stream, defaults to all non-context channels.
|
||||||
interrupt_before: Nodes to interrupt before, defaults to all nodes in the graph.
|
interrupt_before: Nodes to interrupt before, defaults to all nodes in the graph.
|
||||||
interrupt_after: Nodes to interrupt after, defaults to all nodes in the graph.
|
interrupt_after: Nodes to interrupt after, defaults to all nodes in the graph.
|
||||||
durability: The durability mode for the graph execution, defaults to `"async"`.
|
durability: The durability mode for the graph execution, defaults to `"async"`.
|
||||||
|
|
||||||
Options are:
|
Options are:
|
||||||
|
|
||||||
- `"sync"`: Changes are persisted synchronously before the next step starts.
|
- `"sync"`: Changes are persisted synchronously before the next step starts.
|
||||||
- `"async"`: Changes are persisted asynchronously while the next step executes.
|
- `"async"`: Changes are persisted asynchronously while the next step executes.
|
||||||
- `"exit"`: Changes are persisted only when the graph exits.
|
- `"exit"`: Changes are persisted only when the graph exits.
|
||||||
subgraphs: Whether to stream events from inside subgraphs, defaults to False.
|
subgraphs: Whether to stream events from inside subgraphs, defaults to `False`.
|
||||||
|
|
||||||
If `True`, the events will be emitted as tuples `(namespace, data)`,
|
If `True`, the events will be emitted as tuples `(namespace, data)`,
|
||||||
or `(namespace, mode, data)` if `stream_mode` is a list,
|
or `(namespace, mode, data)` if `stream_mode` is a list,
|
||||||
where `namespace` is a tuple with the path to the node where a subgraph is invoked,
|
where `namespace` is a tuple with the path to the node where a subgraph is invoked,
|
||||||
@@ -2689,6 +2699,7 @@ class Pregel(
|
|||||||
context: The static context to use for the run.
|
context: The static context to use for the run.
|
||||||
!!! version-added "Added in version 0.6.0"
|
!!! version-added "Added in version 0.6.0"
|
||||||
stream_mode: The mode to stream output, defaults to `self.stream_mode`.
|
stream_mode: The mode to stream output, defaults to `self.stream_mode`.
|
||||||
|
|
||||||
Options are:
|
Options are:
|
||||||
|
|
||||||
- `"values"`: Emit all values in the state after each step, including interrupts.
|
- `"values"`: Emit all values in the state after each step, including interrupts.
|
||||||
@@ -2697,7 +2708,7 @@ class Pregel(
|
|||||||
If multiple updates are made in the same step (e.g. multiple nodes are run) then those updates are emitted separately.
|
If multiple updates are made in the same step (e.g. multiple nodes are run) then those updates are emitted separately.
|
||||||
- `"custom"`: Emit custom data from inside nodes or tasks using `StreamWriter`.
|
- `"custom"`: Emit custom data from inside nodes or tasks using `StreamWriter`.
|
||||||
- `"messages"`: Emit LLM messages token-by-token together with metadata for any LLM invocations inside nodes or tasks.
|
- `"messages"`: Emit LLM messages token-by-token together with metadata for any LLM invocations inside nodes or tasks.
|
||||||
Will be emitted as 2-tuples `(LLM token, metadata)`.
|
- Will be emitted as 2-tuples `(LLM token, metadata)`.
|
||||||
- `"checkpoints"`: Emit an event when a checkpoint is created, in the same format as returned by `get_state()`.
|
- `"checkpoints"`: Emit an event when a checkpoint is created, in the same format as returned by `get_state()`.
|
||||||
- `"tasks"`: Emit events when tasks start and finish, including their results and errors.
|
- `"tasks"`: Emit events when tasks start and finish, including their results and errors.
|
||||||
- `"debug"`: Emit debug events with as much information as possible for each step.
|
- `"debug"`: Emit debug events with as much information as possible for each step.
|
||||||
@@ -2706,17 +2717,21 @@ class Pregel(
|
|||||||
The streamed outputs will be tuples of `(mode, data)`.
|
The streamed outputs will be tuples of `(mode, data)`.
|
||||||
|
|
||||||
See [LangGraph streaming guide](https://docs.langchain.com/oss/python/langgraph/streaming) for more details.
|
See [LangGraph streaming guide](https://docs.langchain.com/oss/python/langgraph/streaming) for more details.
|
||||||
print_mode: Accepts the same values as `stream_mode`, but only prints the output to the console, for debugging purposes. Does not affect the output of the graph in any way.
|
print_mode: Accepts the same values as `stream_mode`, but only prints the output to the console, for debugging purposes.
|
||||||
|
|
||||||
|
Does not affect the output of the graph in any way.
|
||||||
output_keys: The keys to stream, defaults to all non-context channels.
|
output_keys: The keys to stream, defaults to all non-context channels.
|
||||||
interrupt_before: Nodes to interrupt before, defaults to all nodes in the graph.
|
interrupt_before: Nodes to interrupt before, defaults to all nodes in the graph.
|
||||||
interrupt_after: Nodes to interrupt after, defaults to all nodes in the graph.
|
interrupt_after: Nodes to interrupt after, defaults to all nodes in the graph.
|
||||||
durability: The durability mode for the graph execution, defaults to `"async"`.
|
durability: The durability mode for the graph execution, defaults to `"async"`.
|
||||||
|
|
||||||
Options are:
|
Options are:
|
||||||
|
|
||||||
- `"sync"`: Changes are persisted synchronously before the next step starts.
|
- `"sync"`: Changes are persisted synchronously before the next step starts.
|
||||||
- `"async"`: Changes are persisted asynchronously while the next step executes.
|
- `"async"`: Changes are persisted asynchronously while the next step executes.
|
||||||
- `"exit"`: Changes are persisted only when the graph exits.
|
- `"exit"`: Changes are persisted only when the graph exits.
|
||||||
subgraphs: Whether to stream events from inside subgraphs, defaults to False.
|
subgraphs: Whether to stream events from inside subgraphs, defaults to `False`.
|
||||||
|
|
||||||
If `True`, the events will be emitted as tuples `(namespace, data)`,
|
If `True`, the events will be emitted as tuples `(namespace, data)`,
|
||||||
or `(namespace, mode, data)` if `stream_mode` is a list,
|
or `(namespace, mode, data)` if `stream_mode` is a list,
|
||||||
where `namespace` is a tuple with the path to the node where a subgraph is invoked,
|
where `namespace` is a tuple with the path to the node where a subgraph is invoked,
|
||||||
@@ -3025,11 +3040,14 @@ class Pregel(
|
|||||||
context: The static context to use for the run.
|
context: The static context to use for the run.
|
||||||
!!! version-added "Added in version 0.6.0"
|
!!! version-added "Added in version 0.6.0"
|
||||||
stream_mode: The stream mode for the graph run.
|
stream_mode: The stream mode for the graph run.
|
||||||
print_mode: Accepts the same values as `stream_mode`, but only prints the output to the console, for debugging purposes. Does not affect the output of the graph in any way.
|
print_mode: Accepts the same values as `stream_mode`, but only prints the output to the console, for debugging purposes.
|
||||||
|
|
||||||
|
Does not affect the output of the graph in any way.
|
||||||
output_keys: The output keys to retrieve from the graph run.
|
output_keys: The output keys to retrieve from the graph run.
|
||||||
interrupt_before: The nodes to interrupt the graph run before.
|
interrupt_before: The nodes to interrupt the graph run before.
|
||||||
interrupt_after: The nodes to interrupt the graph run after.
|
interrupt_after: The nodes to interrupt the graph run after.
|
||||||
durability: The durability mode for the graph execution, defaults to `"async"`.
|
durability: The durability mode for the graph execution, defaults to `"async"`.
|
||||||
|
|
||||||
Options are:
|
Options are:
|
||||||
|
|
||||||
- `"sync"`: Changes are persisted synchronously before the next step starts.
|
- `"sync"`: Changes are persisted synchronously before the next step starts.
|
||||||
@@ -3112,11 +3130,14 @@ class Pregel(
|
|||||||
context: The static context to use for the run.
|
context: The static context to use for the run.
|
||||||
!!! version-added "Added in version 0.6.0"
|
!!! version-added "Added in version 0.6.0"
|
||||||
stream_mode: The stream mode for the graph run.
|
stream_mode: The stream mode for the graph run.
|
||||||
print_mode: Accepts the same values as `stream_mode`, but only prints the output to the console, for debugging purposes. Does not affect the output of the graph in any way.
|
print_mode: Accepts the same values as `stream_mode`, but only prints the output to the console, for debugging purposes.
|
||||||
|
|
||||||
|
Does not affect the output of the graph in any way.
|
||||||
output_keys: The output keys to retrieve from the graph run.
|
output_keys: The output keys to retrieve from the graph run.
|
||||||
interrupt_before: The nodes to interrupt the graph run before.
|
interrupt_before: The nodes to interrupt the graph run before.
|
||||||
interrupt_after: The nodes to interrupt the graph run after.
|
interrupt_after: The nodes to interrupt the graph run after.
|
||||||
durability: The durability mode for the graph execution, defaults to `"async"`.
|
durability: The durability mode for the graph execution, defaults to `"async"`.
|
||||||
|
|
||||||
Options are:
|
Options are:
|
||||||
|
|
||||||
- `"sync"`: Changes are persisted synchronously before the next step starts.
|
- `"sync"`: Changes are persisted synchronously before the next step starts.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
from langgraph_sdk.auth import Auth
|
from langgraph_sdk.auth import Auth
|
||||||
from langgraph_sdk.client import get_client, get_sync_client
|
from langgraph_sdk.client import get_client, get_sync_client
|
||||||
|
|
||||||
__version__ = "0.2.9"
|
__version__ = "0.2.10"
|
||||||
|
|
||||||
__all__ = ["Auth", "get_client", "get_sync_client"]
|
__all__ = ["Auth", "get_client", "get_sync_client"]
|
||||||
|
|||||||
@@ -1033,6 +1033,7 @@ class AssistantsClient:
|
|||||||
*,
|
*,
|
||||||
metadata: Json = None,
|
metadata: Json = None,
|
||||||
graph_id: str | None = None,
|
graph_id: str | None = None,
|
||||||
|
name: str | None = None,
|
||||||
limit: int = 10,
|
limit: int = 10,
|
||||||
offset: int = 0,
|
offset: int = 0,
|
||||||
sort_by: AssistantSortBy | None = None,
|
sort_by: AssistantSortBy | None = None,
|
||||||
@@ -1047,6 +1048,8 @@ class AssistantsClient:
|
|||||||
metadata: Metadata to filter by. Exact match filter for each KV pair.
|
metadata: Metadata to filter by. Exact match filter for each KV pair.
|
||||||
graph_id: The ID of the graph to filter by.
|
graph_id: The ID of the graph to filter by.
|
||||||
The graph ID is normally set in your langgraph.json configuration.
|
The graph ID is normally set in your langgraph.json configuration.
|
||||||
|
name: The name of the assistant to filter by.
|
||||||
|
The filtering logic will match assistants where 'name' is a substring (case insensitive) of the assistant name.
|
||||||
limit: The maximum number of results to return.
|
limit: The maximum number of results to return.
|
||||||
offset: The number of results to skip.
|
offset: The number of results to skip.
|
||||||
sort_by: The field to sort by.
|
sort_by: The field to sort by.
|
||||||
@@ -1077,6 +1080,8 @@ class AssistantsClient:
|
|||||||
payload["metadata"] = metadata
|
payload["metadata"] = metadata
|
||||||
if graph_id:
|
if graph_id:
|
||||||
payload["graph_id"] = graph_id
|
payload["graph_id"] = graph_id
|
||||||
|
if name:
|
||||||
|
payload["name"] = name
|
||||||
if sort_by:
|
if sort_by:
|
||||||
payload["sort_by"] = sort_by
|
payload["sort_by"] = sort_by
|
||||||
if sort_order:
|
if sort_order:
|
||||||
@@ -4289,6 +4294,7 @@ class SyncAssistantsClient:
|
|||||||
*,
|
*,
|
||||||
metadata: Json = None,
|
metadata: Json = None,
|
||||||
graph_id: str | None = None,
|
graph_id: str | None = None,
|
||||||
|
name: str | None = None,
|
||||||
limit: int = 10,
|
limit: int = 10,
|
||||||
offset: int = 0,
|
offset: int = 0,
|
||||||
sort_by: AssistantSortBy | None = None,
|
sort_by: AssistantSortBy | None = None,
|
||||||
@@ -4303,6 +4309,8 @@ class SyncAssistantsClient:
|
|||||||
metadata: Metadata to filter by. Exact match filter for each KV pair.
|
metadata: Metadata to filter by. Exact match filter for each KV pair.
|
||||||
graph_id: The ID of the graph to filter by.
|
graph_id: The ID of the graph to filter by.
|
||||||
The graph ID is normally set in your langgraph.json configuration.
|
The graph ID is normally set in your langgraph.json configuration.
|
||||||
|
name: The name of the assistant to filter by.
|
||||||
|
The filtering logic will match assistants where 'name' is a substring (case insensitive) of the assistant name.
|
||||||
limit: The maximum number of results to return.
|
limit: The maximum number of results to return.
|
||||||
offset: The number of results to skip.
|
offset: The number of results to skip.
|
||||||
headers: Optional custom headers to include with the request.
|
headers: Optional custom headers to include with the request.
|
||||||
@@ -4330,6 +4338,8 @@ class SyncAssistantsClient:
|
|||||||
payload["metadata"] = metadata
|
payload["metadata"] = metadata
|
||||||
if graph_id:
|
if graph_id:
|
||||||
payload["graph_id"] = graph_id
|
payload["graph_id"] = graph_id
|
||||||
|
if name:
|
||||||
|
payload["name"] = name
|
||||||
if sort_by:
|
if sort_by:
|
||||||
payload["sort_by"] = sort_by
|
payload["sort_by"] = sort_by
|
||||||
if sort_order:
|
if sort_order:
|
||||||
|
|||||||
@@ -413,6 +413,7 @@ CronSelectField = Literal[
|
|||||||
"next_run_date",
|
"next_run_date",
|
||||||
"metadata",
|
"metadata",
|
||||||
"now",
|
"now",
|
||||||
|
"on_run_completed",
|
||||||
]
|
]
|
||||||
|
|
||||||
PrimitiveData = str | int | float | bool | None
|
PrimitiveData = str | int | float | bool | None
|
||||||
|
|||||||
Reference in New Issue
Block a user