langgraph-checkpoint 2.0.2__tar.gz → 2.0.3__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_checkpoint-2.0.2 → langgraph_checkpoint-2.0.3}/PKG-INFO +1 -1
- {langgraph_checkpoint-2.0.2 → langgraph_checkpoint-2.0.3}/langgraph/checkpoint/memory/__init__.py +4 -0
- {langgraph_checkpoint-2.0.2 → langgraph_checkpoint-2.0.3}/langgraph/checkpoint/serde/jsonplus.py +17 -1
- {langgraph_checkpoint-2.0.2 → langgraph_checkpoint-2.0.3}/langgraph/checkpoint/serde/types.py +9 -0
- {langgraph_checkpoint-2.0.2 → langgraph_checkpoint-2.0.3}/pyproject.toml +1 -1
- {langgraph_checkpoint-2.0.2 → langgraph_checkpoint-2.0.3}/LICENSE +0 -0
- {langgraph_checkpoint-2.0.2 → langgraph_checkpoint-2.0.3}/README.md +0 -0
- {langgraph_checkpoint-2.0.2 → langgraph_checkpoint-2.0.3}/langgraph/checkpoint/base/__init__.py +0 -0
- {langgraph_checkpoint-2.0.2 → langgraph_checkpoint-2.0.3}/langgraph/checkpoint/base/id.py +0 -0
- {langgraph_checkpoint-2.0.2 → langgraph_checkpoint-2.0.3}/langgraph/checkpoint/base/py.typed +0 -0
- {langgraph_checkpoint-2.0.2 → langgraph_checkpoint-2.0.3}/langgraph/checkpoint/memory/py.typed +0 -0
- {langgraph_checkpoint-2.0.2 → langgraph_checkpoint-2.0.3}/langgraph/checkpoint/serde/__init__.py +0 -0
- {langgraph_checkpoint-2.0.2 → langgraph_checkpoint-2.0.3}/langgraph/checkpoint/serde/base.py +0 -0
- {langgraph_checkpoint-2.0.2 → langgraph_checkpoint-2.0.3}/langgraph/checkpoint/serde/py.typed +0 -0
- {langgraph_checkpoint-2.0.2 → langgraph_checkpoint-2.0.3}/langgraph/store/base/__init__.py +0 -0
- {langgraph_checkpoint-2.0.2 → langgraph_checkpoint-2.0.3}/langgraph/store/base/batch.py +0 -0
- {langgraph_checkpoint-2.0.2 → langgraph_checkpoint-2.0.3}/langgraph/store/base/py.typed +0 -0
- {langgraph_checkpoint-2.0.2 → langgraph_checkpoint-2.0.3}/langgraph/store/memory/__init__.py +0 -0
- {langgraph_checkpoint-2.0.2 → langgraph_checkpoint-2.0.3}/langgraph/store/memory/py.typed +0 -0
{langgraph_checkpoint-2.0.2 → langgraph_checkpoint-2.0.3}/langgraph/checkpoint/memory/__init__.py
RENAMED
|
@@ -364,8 +364,12 @@ class MemorySaver(
|
|
|
364
364
|
checkpoint_ns = config["configurable"]["checkpoint_ns"]
|
|
365
365
|
checkpoint_id = config["configurable"]["checkpoint_id"]
|
|
366
366
|
outer_key = (thread_id, checkpoint_ns, checkpoint_id)
|
|
367
|
+
outer_writes_ = self.writes.get(outer_key)
|
|
367
368
|
for idx, (c, v) in enumerate(writes):
|
|
368
369
|
inner_key = (task_id, WRITES_IDX_MAP.get(c, idx))
|
|
370
|
+
if inner_key[1] >= 0 and outer_writes_ and inner_key in outer_writes_:
|
|
371
|
+
continue
|
|
372
|
+
|
|
369
373
|
self.writes[outer_key][inner_key] = (task_id, c, self.serde.dumps_typed(v))
|
|
370
374
|
|
|
371
375
|
async def aget_tuple(self, config: RunnableConfig) -> Optional[CheckpointTuple]:
|
{langgraph_checkpoint-2.0.2 → langgraph_checkpoint-2.0.3}/langgraph/checkpoint/serde/jsonplus.py
RENAMED
|
@@ -25,7 +25,7 @@ from langchain_core.load.serializable import Serializable
|
|
|
25
25
|
from zoneinfo import ZoneInfo
|
|
26
26
|
|
|
27
27
|
from langgraph.checkpoint.serde.base import SerializerProtocol
|
|
28
|
-
from langgraph.checkpoint.serde.types import SendProtocol
|
|
28
|
+
from langgraph.checkpoint.serde.types import CommandProtocol, SendProtocol
|
|
29
29
|
from langgraph.store.base import Item
|
|
30
30
|
|
|
31
31
|
LC_REVIVER = Reviver()
|
|
@@ -122,6 +122,11 @@ class JsonPlusSerializer(SerializerProtocol):
|
|
|
122
122
|
return self._encode_constructor_args(
|
|
123
123
|
obj.__class__, kwargs={"node": obj.node, "arg": obj.arg}
|
|
124
124
|
)
|
|
125
|
+
elif isinstance(obj, CommandProtocol):
|
|
126
|
+
return self._encode_constructor_args(
|
|
127
|
+
obj.__class__,
|
|
128
|
+
kwargs={k: getattr(obj, k) for k in obj.__all_slots__},
|
|
129
|
+
)
|
|
125
130
|
elif isinstance(obj, (bytes, bytearray)):
|
|
126
131
|
return self._encode_constructor_args(
|
|
127
132
|
obj.__class__, method="fromhex", args=(obj.hex(),)
|
|
@@ -402,6 +407,17 @@ def _msgpack_default(obj: Any) -> Union[str, msgpack.ExtType]:
|
|
|
402
407
|
(obj.__class__.__module__, obj.__class__.__name__, (obj.node, obj.arg)),
|
|
403
408
|
),
|
|
404
409
|
)
|
|
410
|
+
elif isinstance(obj, CommandProtocol):
|
|
411
|
+
return msgpack.ExtType(
|
|
412
|
+
EXT_CONSTRUCTOR_KW_ARGS,
|
|
413
|
+
_msgpack_enc(
|
|
414
|
+
(
|
|
415
|
+
obj.__class__.__module__,
|
|
416
|
+
obj.__class__.__name__,
|
|
417
|
+
{k: getattr(obj, k) for k in obj.__all_slots__},
|
|
418
|
+
),
|
|
419
|
+
),
|
|
420
|
+
)
|
|
405
421
|
elif dataclasses.is_dataclass(obj):
|
|
406
422
|
# doesn't use dataclasses.asdict to avoid deepcopy and recursion
|
|
407
423
|
return msgpack.ExtType(
|
{langgraph_checkpoint-2.0.2 → langgraph_checkpoint-2.0.3}/langgraph/checkpoint/serde/types.py
RENAMED
|
@@ -4,6 +4,7 @@ from typing import (
|
|
|
4
4
|
Protocol,
|
|
5
5
|
Sequence,
|
|
6
6
|
TypeVar,
|
|
7
|
+
Union,
|
|
7
8
|
runtime_checkable,
|
|
8
9
|
)
|
|
9
10
|
|
|
@@ -48,3 +49,11 @@ class SendProtocol(Protocol):
|
|
|
48
49
|
def __repr__(self) -> str: ...
|
|
49
50
|
|
|
50
51
|
def __eq__(self, value: object) -> bool: ...
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
@runtime_checkable
|
|
55
|
+
class CommandProtocol(Protocol):
|
|
56
|
+
# Mirrors langgraph.types.Command
|
|
57
|
+
update: Optional[dict[str, Any]]
|
|
58
|
+
send: Union[Any, Sequence[Any]]
|
|
59
|
+
__all_slots__: set[str]
|
|
File without changes
|
|
File without changes
|
{langgraph_checkpoint-2.0.2 → langgraph_checkpoint-2.0.3}/langgraph/checkpoint/base/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{langgraph_checkpoint-2.0.2 → langgraph_checkpoint-2.0.3}/langgraph/checkpoint/base/py.typed
RENAMED
|
File without changes
|
{langgraph_checkpoint-2.0.2 → langgraph_checkpoint-2.0.3}/langgraph/checkpoint/memory/py.typed
RENAMED
|
File without changes
|
{langgraph_checkpoint-2.0.2 → langgraph_checkpoint-2.0.3}/langgraph/checkpoint/serde/__init__.py
RENAMED
|
File without changes
|
{langgraph_checkpoint-2.0.2 → langgraph_checkpoint-2.0.3}/langgraph/checkpoint/serde/base.py
RENAMED
|
File without changes
|
{langgraph_checkpoint-2.0.2 → langgraph_checkpoint-2.0.3}/langgraph/checkpoint/serde/py.typed
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{langgraph_checkpoint-2.0.2 → langgraph_checkpoint-2.0.3}/langgraph/store/memory/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|