langgraph 1.2.22__tar.gz → 1.2.23__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {langgraph-1.2.22 → langgraph-1.2.23}/PKG-INFO +2 -2
- {langgraph-1.2.22 → langgraph-1.2.23}/langgraph/_internal/_constants.py +4 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/langgraph/_internal/_pydantic.py +10 -26
- {langgraph-1.2.22 → langgraph-1.2.23}/langgraph/pregel/_algo.py +13 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/pyproject.toml +2 -2
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/test_pydantic.py +123 -1
- {langgraph-1.2.22 → langgraph-1.2.23}/uv.lock +11 -11
- {langgraph-1.2.22 → langgraph-1.2.23}/.gitignore +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/LICENSE +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/Makefile +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/README.md +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/bench/__init__.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/bench/__main__.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/bench/fanout_to_subgraph.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/bench/pydantic_state.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/bench/react_agent.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/bench/sequential.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/bench/serde_allowlist.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/bench/wide_dict.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/bench/wide_state.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/langgraph/_internal/__init__.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/langgraph/_internal/_cache.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/langgraph/_internal/_config.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/langgraph/_internal/_fields.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/langgraph/_internal/_future.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/langgraph/_internal/_queue.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/langgraph/_internal/_replay.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/langgraph/_internal/_retry.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/langgraph/_internal/_runnable.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/langgraph/_internal/_scratchpad.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/langgraph/_internal/_serde.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/langgraph/_internal/_timeout.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/langgraph/_internal/_typing.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/langgraph/callbacks.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/langgraph/channels/__init__.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/langgraph/channels/any_value.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/langgraph/channels/base.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/langgraph/channels/binop.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/langgraph/channels/delta.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/langgraph/channels/ephemeral_value.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/langgraph/channels/last_value.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/langgraph/channels/named_barrier_value.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/langgraph/channels/topic.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/langgraph/channels/untracked_value.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/langgraph/config.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/langgraph/constants.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/langgraph/errors.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/langgraph/func/__init__.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/langgraph/graph/__init__.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/langgraph/graph/_branch.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/langgraph/graph/_node.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/langgraph/graph/message.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/langgraph/graph/state.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/langgraph/graph/ui.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/langgraph/managed/__init__.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/langgraph/managed/base.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/langgraph/managed/is_last_step.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/langgraph/pregel/__init__.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/langgraph/pregel/_call.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/langgraph/pregel/_checkpoint.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/langgraph/pregel/_config.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/langgraph/pregel/_draw.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/langgraph/pregel/_executor.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/langgraph/pregel/_io.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/langgraph/pregel/_log.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/langgraph/pregel/_loop.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/langgraph/pregel/_messages.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/langgraph/pregel/_read.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/langgraph/pregel/_remote_run_stream.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/langgraph/pregel/_retry.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/langgraph/pregel/_runner.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/langgraph/pregel/_task_status.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/langgraph/pregel/_tools.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/langgraph/pregel/_utils.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/langgraph/pregel/_validate.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/langgraph/pregel/_write.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/langgraph/pregel/debug.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/langgraph/pregel/main.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/langgraph/pregel/protocol.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/langgraph/pregel/remote.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/langgraph/pregel/types.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/langgraph/py.typed +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/langgraph/runtime.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/langgraph/stream/__init__.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/langgraph/stream/_convert.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/langgraph/stream/_mux.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/langgraph/stream/_types.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/langgraph/stream/run_stream.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/langgraph/stream/stream_channel.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/langgraph/stream/transformers.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/langgraph/types.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/langgraph/typing.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/langgraph/utils/__init__.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/langgraph/utils/config.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/langgraph/utils/runnable.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/langgraph/version.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/langgraph/warnings.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/__init__.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/__snapshots__/test_large_cases.ambr +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/__snapshots__/test_pregel.ambr +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/__snapshots__/test_pregel_async.ambr +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/agents.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/any_int.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/any_str.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/compose-postgres.yml +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/compose-redis.yml +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/conftest.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/conftest_checkpointer.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/conftest_store.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/example_app/example_graph.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/example_app/langgraph.json +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/example_app/requirements.txt +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/fake_chat.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/fake_tracer.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/memory_assert.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/messages.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/test_algo.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/test_channels.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/test_checkpoint_migration.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/test_config_async.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/test_delta_channel_benchmark.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/test_delta_channel_exit_mode.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/test_delta_channel_fork.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/test_delta_channel_id_stability.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/test_delta_channel_migration.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/test_delta_channel_node_cache.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/test_delta_channel_parallel_order.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/test_delta_channel_run_input.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/test_delta_channel_seal_subscribers.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/test_delta_channel_subgraph.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/test_delta_channel_supersteps_bound.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/test_delta_channel_to_plain.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/test_delta_channel_update_overwrite.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/test_delta_channel_update_state.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/test_delta_channel_write_failures.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/test_deprecation.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/test_graph_callbacks.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/test_interleave_arrival_order.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/test_interrupt_migration.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/test_interrupt_state.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/test_interruption.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/test_large_cases.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/test_large_cases_async.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/test_managed_values.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/test_messages_state.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/test_parent_command.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/test_parent_command_async.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/test_pregel.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/test_pregel_async.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/test_pregel_debug.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/test_pregel_stream_events_v3.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/test_prune_postgres.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/test_remote_graph.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/test_remote_graph_v3.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/test_retry.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/test_runnable.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/test_runner_futures.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/test_runtime.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/test_serde_allowlist.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/test_state.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/test_stream_before_builtins.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/test_stream_data_transformers.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/test_stream_events_v3.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/test_stream_events_v3_e2e.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/test_stream_events_v3_kwarg_forwarding.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/test_stream_lifecycle_transformer.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/test_stream_messages_transformer.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/test_stream_namespaces.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/test_stream_subgraph_transformer.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/test_strict_resume.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/test_subgraph_detection.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/test_subgraph_persistence.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/test_subgraph_persistence_async.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/test_time_travel.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/test_time_travel_async.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/test_tool_stream_handler.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/test_trace_policy.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/test_tracing_interops.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/test_type_checking.py +0 -0
- {langgraph-1.2.22 → langgraph-1.2.23}/tests/test_utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: langgraph
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.23
|
|
4
4
|
Summary: Building stateful, multi-actor applications with LLMs
|
|
5
5
|
Project-URL: Homepage, https://docs.langchain.com/oss/python/langgraph/overview
|
|
6
6
|
Project-URL: Documentation, https://reference.langchain.com/python/langgraph/
|
|
@@ -24,7 +24,7 @@ Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
|
24
24
|
Requires-Python: >=3.10
|
|
25
25
|
Requires-Dist: langchain-core<2,>=1.4.7
|
|
26
26
|
Requires-Dist: langgraph-checkpoint<5.0.0,>=4.3.0
|
|
27
|
-
Requires-Dist: langgraph-prebuilt<1.2.0,>=1.1.
|
|
27
|
+
Requires-Dist: langgraph-prebuilt<1.2.0,>=1.1.3
|
|
28
28
|
Requires-Dist: langgraph-sdk<0.5.0,>=0.4.6
|
|
29
29
|
Requires-Dist: pydantic>=2.7.4
|
|
30
30
|
Requires-Dist: xxhash>=3.5.0
|
|
@@ -37,6 +37,10 @@ CONFIG_KEY_SEND = sys.intern("__pregel_send")
|
|
|
37
37
|
# holds the `write` function that accepts writes to state/edges/reserved keys
|
|
38
38
|
CONFIG_KEY_READ = sys.intern("__pregel_read")
|
|
39
39
|
# holds the `read` function that returns a copy of the current state
|
|
40
|
+
CONFIG_KEY_READ_STATE = sys.intern("__pregel_read_state")
|
|
41
|
+
# holds a function that returns the state as the task's node gets it from an edge,
|
|
42
|
+
# set on Send tasks, whose input is the Send arg instead. Other tasks set it to None
|
|
43
|
+
# so a graph running inside a Send task never reads its parent's state
|
|
40
44
|
CONFIG_KEY_CALL = sys.intern("__pregel_call")
|
|
41
45
|
# holds the `call` function that accepts a node/func, args and returns a future
|
|
42
46
|
CONFIG_KEY_CHECKPOINTER = sys.intern("__pregel_checkpointer")
|
|
@@ -2,8 +2,6 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
import sys
|
|
4
4
|
import typing
|
|
5
|
-
import warnings
|
|
6
|
-
from contextlib import nullcontext
|
|
7
5
|
from dataclasses import is_dataclass
|
|
8
6
|
from functools import lru_cache
|
|
9
7
|
from typing import (
|
|
@@ -105,8 +103,7 @@ def _create_root_model(
|
|
|
105
103
|
|
|
106
104
|
if default_ is not NO_DEFAULT:
|
|
107
105
|
base_class_attributes["root"] = default_
|
|
108
|
-
|
|
109
|
-
custom_root_type = type(name, (RootModel,), base_class_attributes)
|
|
106
|
+
custom_root_type = type(name, (RootModel,), base_class_attributes)
|
|
110
107
|
return cast("type[BaseModel]", custom_root_type)
|
|
111
108
|
|
|
112
109
|
|
|
@@ -225,28 +222,15 @@ def create_model(
|
|
|
225
222
|
)
|
|
226
223
|
return named_root_model
|
|
227
224
|
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
with warnings.catch_warnings() if capture_warnings else nullcontext():
|
|
239
|
-
if capture_warnings:
|
|
240
|
-
warnings.filterwarnings(action="ignore")
|
|
241
|
-
try:
|
|
242
|
-
return _create_model_cached(model_name, **field_definitions)
|
|
243
|
-
except TypeError:
|
|
244
|
-
# something in field definitions is not hashable
|
|
245
|
-
return _create_model_base(
|
|
246
|
-
model_name,
|
|
247
|
-
__config__=_SchemaConfig,
|
|
248
|
-
**_remap_field_definitions(field_definitions),
|
|
249
|
-
)
|
|
225
|
+
try:
|
|
226
|
+
return _create_model_cached(model_name, **field_definitions)
|
|
227
|
+
except TypeError:
|
|
228
|
+
# something in field definitions is not hashable
|
|
229
|
+
return _create_model_base(
|
|
230
|
+
model_name,
|
|
231
|
+
__config__=_SchemaConfig,
|
|
232
|
+
**_remap_field_definitions(field_definitions),
|
|
233
|
+
)
|
|
250
234
|
|
|
251
235
|
|
|
252
236
|
def is_supported_by_pydantic(type_: Any) -> bool:
|
|
@@ -42,6 +42,7 @@ from langgraph._internal._constants import (
|
|
|
42
42
|
CONFIG_KEY_CHECKPOINTER,
|
|
43
43
|
CONFIG_KEY_NODE_ERROR,
|
|
44
44
|
CONFIG_KEY_READ,
|
|
45
|
+
CONFIG_KEY_READ_STATE,
|
|
45
46
|
CONFIG_KEY_RESUME_MAP,
|
|
46
47
|
CONFIG_KEY_RUNTIME,
|
|
47
48
|
CONFIG_KEY_SCRATCHPAD,
|
|
@@ -734,6 +735,7 @@ def prepare_single_task(
|
|
|
734
735
|
triggers,
|
|
735
736
|
),
|
|
736
737
|
),
|
|
738
|
+
CONFIG_KEY_READ_STATE: None,
|
|
737
739
|
CONFIG_KEY_CHECKPOINTER: (
|
|
738
740
|
checkpointer
|
|
739
741
|
or configurable.get(CONFIG_KEY_CHECKPOINTER)
|
|
@@ -911,6 +913,7 @@ def prepare_push_task_functional(
|
|
|
911
913
|
managed,
|
|
912
914
|
PregelTaskWrites(in_progress_task_path, name, writes, triggers),
|
|
913
915
|
),
|
|
916
|
+
CONFIG_KEY_READ_STATE: None,
|
|
914
917
|
CONFIG_KEY_CHECKPOINTER: (
|
|
915
918
|
checkpointer or configurable.get(CONFIG_KEY_CHECKPOINTER)
|
|
916
919
|
),
|
|
@@ -1081,6 +1084,15 @@ def prepare_push_task_send(
|
|
|
1081
1084
|
translated_task_path, packet.node, writes, triggers
|
|
1082
1085
|
),
|
|
1083
1086
|
),
|
|
1087
|
+
CONFIG_KEY_READ_STATE: partial(
|
|
1088
|
+
_proc_input,
|
|
1089
|
+
proc,
|
|
1090
|
+
managed,
|
|
1091
|
+
channels,
|
|
1092
|
+
for_execution=True,
|
|
1093
|
+
scratchpad=scratchpad,
|
|
1094
|
+
input_cache=None,
|
|
1095
|
+
),
|
|
1084
1096
|
CONFIG_KEY_CHECKPOINTER: (
|
|
1085
1097
|
checkpointer or configurable.get(CONFIG_KEY_CHECKPOINTER)
|
|
1086
1098
|
),
|
|
@@ -1222,6 +1234,7 @@ def prepare_node_error_handler_task(
|
|
|
1222
1234
|
PUSH_TRIGGER,
|
|
1223
1235
|
),
|
|
1224
1236
|
),
|
|
1237
|
+
CONFIG_KEY_READ_STATE: None,
|
|
1225
1238
|
CONFIG_KEY_CHECKPOINTER: (
|
|
1226
1239
|
checkpointer or configurable.get(CONFIG_KEY_CHECKPOINTER)
|
|
1227
1240
|
),
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "langgraph"
|
|
7
|
-
version = "1.2.
|
|
7
|
+
version = "1.2.23"
|
|
8
8
|
description = "Building stateful, multi-actor applications with LLMs"
|
|
9
9
|
authors = []
|
|
10
10
|
requires-python = ">=3.10"
|
|
@@ -27,7 +27,7 @@ dependencies = [
|
|
|
27
27
|
"langchain-core>=1.4.7,<2",
|
|
28
28
|
"langgraph-checkpoint>=4.3.0,<5.0.0",
|
|
29
29
|
"langgraph-sdk>=0.4.6,<0.5.0",
|
|
30
|
-
"langgraph-prebuilt>=1.1.
|
|
30
|
+
"langgraph-prebuilt>=1.1.3,<1.2.0",
|
|
31
31
|
"xxhash>=3.5.0",
|
|
32
32
|
"pydantic>=2.7.4",
|
|
33
33
|
]
|
|
@@ -6,10 +6,14 @@ import re
|
|
|
6
6
|
import sys
|
|
7
7
|
import typing
|
|
8
8
|
import uuid
|
|
9
|
+
import warnings
|
|
10
|
+
from concurrent.futures import ThreadPoolExecutor
|
|
9
11
|
from enum import Enum
|
|
12
|
+
from threading import Event
|
|
10
13
|
from typing import Annotated, Literal, Optional
|
|
11
14
|
|
|
12
15
|
import pydantic
|
|
16
|
+
import pytest
|
|
13
17
|
import typing_extensions
|
|
14
18
|
from langgraph.checkpoint.base import BaseCheckpointSaver
|
|
15
19
|
from pydantic import (
|
|
@@ -25,7 +29,7 @@ from pydantic import (
|
|
|
25
29
|
model_validator,
|
|
26
30
|
)
|
|
27
31
|
|
|
28
|
-
from langgraph._internal._pydantic import is_supported_by_pydantic
|
|
32
|
+
from langgraph._internal._pydantic import create_model, is_supported_by_pydantic
|
|
29
33
|
from langgraph.constants import END, START
|
|
30
34
|
from langgraph.func import entrypoint, task
|
|
31
35
|
from langgraph.graph.state import StateGraph
|
|
@@ -33,6 +37,124 @@ from langgraph.types import Command, Interrupt, interrupt
|
|
|
33
37
|
from tests.any_str import AnyStr
|
|
34
38
|
|
|
35
39
|
|
|
40
|
+
@pytest.mark.parametrize("root_model", [False, True], ids=["fields", "root"])
|
|
41
|
+
@pytest.mark.parametrize("default", [None, []], ids=["cached", "uncached"])
|
|
42
|
+
def test_create_model_preserves_concurrent_warnings(root_model, default) -> None:
|
|
43
|
+
schema_started = Event()
|
|
44
|
+
warning_emitted = Event()
|
|
45
|
+
|
|
46
|
+
class PausedSchema:
|
|
47
|
+
@classmethod
|
|
48
|
+
def __get_pydantic_core_schema__(cls, source, handler):
|
|
49
|
+
schema_started.set()
|
|
50
|
+
assert warning_emitted.wait(timeout=10)
|
|
51
|
+
return handler(source)
|
|
52
|
+
|
|
53
|
+
type_ = Annotated[list[int] | None, PausedSchema]
|
|
54
|
+
kwargs = (
|
|
55
|
+
{"root": (type_, default)}
|
|
56
|
+
if root_model
|
|
57
|
+
else {"field_definitions": {"model_values": (type_, default)}}
|
|
58
|
+
)
|
|
59
|
+
with warnings.catch_warnings(record=True) as captured:
|
|
60
|
+
warnings.simplefilter("always")
|
|
61
|
+
with ThreadPoolExecutor(max_workers=1) as executor:
|
|
62
|
+
future = executor.submit(create_model, "ConcurrentSchema", **kwargs)
|
|
63
|
+
try:
|
|
64
|
+
assert schema_started.wait(timeout=10)
|
|
65
|
+
warnings.warn("unrelated concurrent warning", UserWarning)
|
|
66
|
+
warnings.simplefilter("error", DeprecationWarning)
|
|
67
|
+
finally:
|
|
68
|
+
warning_emitted.set()
|
|
69
|
+
model = future.result(timeout=10)
|
|
70
|
+
|
|
71
|
+
assert [str(warning.message) for warning in captured] == [
|
|
72
|
+
"unrelated concurrent warning"
|
|
73
|
+
]
|
|
74
|
+
with pytest.raises(DeprecationWarning, match="retained warning filter"):
|
|
75
|
+
warnings.warn("retained warning filter", DeprecationWarning)
|
|
76
|
+
|
|
77
|
+
instance = model.model_validate(["1"] if root_model else {"model_values": ["1"]})
|
|
78
|
+
assert instance.model_dump() == ([1] if root_model else {"model_values": [1]})
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
@pytest.mark.parametrize("default", [0, []], ids=["cached", "uncached"])
|
|
82
|
+
def test_create_model_model_fields(default) -> None:
|
|
83
|
+
with warnings.catch_warnings():
|
|
84
|
+
warnings.simplefilter("error")
|
|
85
|
+
model = create_model(
|
|
86
|
+
"ModelFields",
|
|
87
|
+
field_definitions={
|
|
88
|
+
"model_id": (int, ...),
|
|
89
|
+
"model_name": (str, "default"),
|
|
90
|
+
"model_dump": (str, ...),
|
|
91
|
+
"_private": (int, 0),
|
|
92
|
+
"model_value": (int | list[int], default),
|
|
93
|
+
},
|
|
94
|
+
)
|
|
95
|
+
|
|
96
|
+
instance = model.model_validate(
|
|
97
|
+
{"model_id": "1", "model_dump": "data", "_private": "2"}
|
|
98
|
+
)
|
|
99
|
+
assert model.__name__ == "ModelFields"
|
|
100
|
+
assert instance.model_dump(by_alias=True) == {
|
|
101
|
+
"model_id": 1,
|
|
102
|
+
"model_name": "default",
|
|
103
|
+
"model_dump": "data",
|
|
104
|
+
"_private": 2,
|
|
105
|
+
"model_value": default,
|
|
106
|
+
}
|
|
107
|
+
with pytest.raises(pydantic.ValidationError, match="model_id"):
|
|
108
|
+
model.model_validate({"model_id": "invalid", "model_dump": "data"})
|
|
109
|
+
with pytest.raises(pydantic.ValidationError, match="frozen_instance"):
|
|
110
|
+
instance.model_id = 2
|
|
111
|
+
|
|
112
|
+
schema = model.model_json_schema()
|
|
113
|
+
assert schema["title"] == "ModelFields"
|
|
114
|
+
assert schema["required"] == ["model_id", "model_dump"]
|
|
115
|
+
assert set(schema["properties"]) == {
|
|
116
|
+
"model_id",
|
|
117
|
+
"model_name",
|
|
118
|
+
"model_dump",
|
|
119
|
+
"_private",
|
|
120
|
+
"model_value",
|
|
121
|
+
}
|
|
122
|
+
assert schema["properties"]["model_dump"] == {
|
|
123
|
+
"title": "Model Dump",
|
|
124
|
+
"type": "string",
|
|
125
|
+
}
|
|
126
|
+
assert schema["properties"]["model_value"]["default"] == default
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
@pytest.mark.parametrize("default", [0, []], ids=["cached", "uncached"])
|
|
130
|
+
def test_create_root_model_defaults(default) -> None:
|
|
131
|
+
model = create_model("RootSchema", root=(int | list[int], default))
|
|
132
|
+
assert model.__name__ == "RootSchema"
|
|
133
|
+
assert model().model_dump() == default
|
|
134
|
+
assert model.model_validate("2").model_dump() == 2
|
|
135
|
+
schema = model.model_json_schema()
|
|
136
|
+
assert schema == {
|
|
137
|
+
"anyOf": [{"type": "integer"}, {"items": {"type": "integer"}, "type": "array"}],
|
|
138
|
+
"default": default,
|
|
139
|
+
"title": "RootSchema",
|
|
140
|
+
}
|
|
141
|
+
with pytest.warns(pydantic.PydanticDeprecatedSince20, match="deprecated"):
|
|
142
|
+
assert model.schema() == schema
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
def test_create_model_preserves_schema_warnings() -> None:
|
|
146
|
+
class WarningSchema:
|
|
147
|
+
@classmethod
|
|
148
|
+
def __get_pydantic_core_schema__(cls, source, handler):
|
|
149
|
+
warnings.warn("custom schema warning", UserWarning)
|
|
150
|
+
return handler(source)
|
|
151
|
+
|
|
152
|
+
with pytest.warns(UserWarning, match="custom schema warning"):
|
|
153
|
+
create_model(
|
|
154
|
+
"WarningSchema", field_definitions={"model_value": (WarningSchema, ...)}
|
|
155
|
+
)
|
|
156
|
+
|
|
157
|
+
|
|
36
158
|
def test_is_supported_by_pydantic() -> None:
|
|
37
159
|
"""Test if types are supported by pydantic."""
|
|
38
160
|
|
|
@@ -1440,7 +1440,7 @@ wheels = [
|
|
|
1440
1440
|
|
|
1441
1441
|
[[package]]
|
|
1442
1442
|
name = "langgraph"
|
|
1443
|
-
version = "1.2.
|
|
1443
|
+
version = "1.2.23"
|
|
1444
1444
|
source = { editable = "." }
|
|
1445
1445
|
dependencies = [
|
|
1446
1446
|
{ name = "langchain-core" },
|
|
@@ -1827,7 +1827,7 @@ test = [
|
|
|
1827
1827
|
|
|
1828
1828
|
[[package]]
|
|
1829
1829
|
name = "langgraph-prebuilt"
|
|
1830
|
-
version = "1.1.
|
|
1830
|
+
version = "1.1.3"
|
|
1831
1831
|
source = { editable = "../prebuilt" }
|
|
1832
1832
|
dependencies = [
|
|
1833
1833
|
{ name = "langchain-core" },
|
|
@@ -2182,14 +2182,14 @@ wheels = [
|
|
|
2182
2182
|
|
|
2183
2183
|
[[package]]
|
|
2184
2184
|
name = "opentelemetry-api"
|
|
2185
|
-
version = "1.45.
|
|
2185
|
+
version = "1.45.2"
|
|
2186
2186
|
source = { registry = "https://pypi.org/simple" }
|
|
2187
2187
|
dependencies = [
|
|
2188
2188
|
{ name = "typing-extensions" },
|
|
2189
2189
|
]
|
|
2190
|
-
sdist = { url = "https://files.pythonhosted.org/packages/
|
|
2190
|
+
sdist = { url = "https://files.pythonhosted.org/packages/19/14/cf3a6b6448849656e1e5f4e2101f3988dc6789724050096aba1bc5ccf592/opentelemetry_api-1.45.2.tar.gz", hash = "sha256:d7b0008e21e5fd61cbe7a7f34ca3b6905a78ab677d9bc395e299359c75cda6b4", size = 73277, upload-time = "2026-10-29T17:29:37.888Z" }
|
|
2191
2191
|
wheels = [
|
|
2192
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
2192
|
+
{ url = "https://files.pythonhosted.org/packages/a9/2d/610db864d7513158cebb8f36cc88e67e73bd6c7aa1905ef18d89e1281c81/opentelemetry_api-1.45.2-py3-none-any.whl", hash = "sha256:2cbd737377e710ee740d261c94e93fa0f08e6d037c18f17513cc0a2d94479a34", size = 60335, upload-time = "2026-10-29T17:29:06.955Z" },
|
|
2193
2193
|
]
|
|
2194
2194
|
|
|
2195
2195
|
[[package]]
|
|
@@ -2281,29 +2281,29 @@ wheels = [
|
|
|
2281
2281
|
|
|
2282
2282
|
[[package]]
|
|
2283
2283
|
name = "opentelemetry-sdk"
|
|
2284
|
-
version = "1.45.
|
|
2284
|
+
version = "1.45.2"
|
|
2285
2285
|
source = { registry = "https://pypi.org/simple" }
|
|
2286
2286
|
dependencies = [
|
|
2287
2287
|
{ name = "opentelemetry-api" },
|
|
2288
2288
|
{ name = "opentelemetry-semantic-conventions" },
|
|
2289
2289
|
{ name = "typing-extensions" },
|
|
2290
2290
|
]
|
|
2291
|
-
sdist = { url = "https://files.pythonhosted.org/packages/
|
|
2291
|
+
sdist = { url = "https://files.pythonhosted.org/packages/7b/1a/74a21d4d6969fb8b432ac397e66112a8167a6deb267ea4559dbaf2fe91ef/opentelemetry_sdk-1.45.2.tar.gz", hash = "sha256:7eec4de13dd21ff3a1670dcb0e02079e692736f94d733dfdce5af461d884248d", size = 221705, upload-time = "2026-10-29T17:29:54.685Z" }
|
|
2292
2292
|
wheels = [
|
|
2293
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
2293
|
+
{ url = "https://files.pythonhosted.org/packages/9f/a5/9a3b793ef48245f2336a16beb2324c2397dbb3f987cd68942f77cca06156/opentelemetry_sdk-1.45.2-py3-none-any.whl", hash = "sha256:ff974ea70ee4f1d51e2ec152db37c2b626c7bf82bb3f7d86114fd8704e7199c6", size = 141756, upload-time = "2026-10-29T17:29:33.722Z" },
|
|
2294
2294
|
]
|
|
2295
2295
|
|
|
2296
2296
|
[[package]]
|
|
2297
2297
|
name = "opentelemetry-semantic-conventions"
|
|
2298
|
-
version = "0.
|
|
2298
|
+
version = "0.66b2"
|
|
2299
2299
|
source = { registry = "https://pypi.org/simple" }
|
|
2300
2300
|
dependencies = [
|
|
2301
2301
|
{ name = "opentelemetry-api" },
|
|
2302
2302
|
{ name = "typing-extensions" },
|
|
2303
2303
|
]
|
|
2304
|
-
sdist = { url = "https://files.pythonhosted.org/packages/
|
|
2304
|
+
sdist = { url = "https://files.pythonhosted.org/packages/37/3f/50f95972b50e8e353f5b9342034c9cd17730f1956f009ce6a3fbbd89f9ce/opentelemetry_semantic_conventions-0.66b2.tar.gz", hash = "sha256:7da5f1a5dc4383eb66711d4d3d3e71824d9403ac1559fea021cc103c1a4c4976", size = 150246, upload-time = "2026-10-29T17:29:55.682Z" }
|
|
2305
2305
|
wheels = [
|
|
2306
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
2306
|
+
{ url = "https://files.pythonhosted.org/packages/67/bd/6bf33ed31521c565931c037e9e81bac47c1acb000e850c6e24220e2a0c00/opentelemetry_semantic_conventions-0.66b2-py3-none-any.whl", hash = "sha256:4cbe61e5f9275d57ab31708446e7938ef4291ebbe6a7fca6f7a629c5acae87d8", size = 206280, upload-time = "2026-10-29T17:29:35.062Z" },
|
|
2307
2307
|
]
|
|
2308
2308
|
|
|
2309
2309
|
[[package]]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|