langgraph-runtime-inmem 0.36.0.dev6__tar.gz → 0.36.0.dev8__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_runtime_inmem-0.36.0.dev6 → langgraph_runtime_inmem-0.36.0.dev8}/PKG-INFO +1 -1
- {langgraph_runtime_inmem-0.36.0.dev6 → langgraph_runtime_inmem-0.36.0.dev8}/langgraph_runtime_inmem/__init__.py +1 -1
- {langgraph_runtime_inmem-0.36.0.dev6 → langgraph_runtime_inmem-0.36.0.dev8}/langgraph_runtime_inmem/checkpoint.py +47 -0
- {langgraph_runtime_inmem-0.36.0.dev6 → langgraph_runtime_inmem-0.36.0.dev8}/langgraph_runtime_inmem/ops.py +11 -5
- {langgraph_runtime_inmem-0.36.0.dev6 → langgraph_runtime_inmem-0.36.0.dev8}/uv.lock +7 -7
- {langgraph_runtime_inmem-0.36.0.dev6 → langgraph_runtime_inmem-0.36.0.dev8}/.gitignore +0 -0
- {langgraph_runtime_inmem-0.36.0.dev6 → langgraph_runtime_inmem-0.36.0.dev8}/Makefile +0 -0
- {langgraph_runtime_inmem-0.36.0.dev6 → langgraph_runtime_inmem-0.36.0.dev8}/README.md +0 -0
- {langgraph_runtime_inmem-0.36.0.dev6 → langgraph_runtime_inmem-0.36.0.dev8}/langgraph_runtime_inmem/_persistence.py +0 -0
- {langgraph_runtime_inmem-0.36.0.dev6 → langgraph_runtime_inmem-0.36.0.dev8}/langgraph_runtime_inmem/database.py +0 -0
- {langgraph_runtime_inmem-0.36.0.dev6 → langgraph_runtime_inmem-0.36.0.dev8}/langgraph_runtime_inmem/inmem_stream.py +0 -0
- {langgraph_runtime_inmem-0.36.0.dev6 → langgraph_runtime_inmem-0.36.0.dev8}/langgraph_runtime_inmem/lifespan.py +0 -0
- {langgraph_runtime_inmem-0.36.0.dev6 → langgraph_runtime_inmem-0.36.0.dev8}/langgraph_runtime_inmem/metrics.py +0 -0
- {langgraph_runtime_inmem-0.36.0.dev6 → langgraph_runtime_inmem-0.36.0.dev8}/langgraph_runtime_inmem/queue.py +0 -0
- {langgraph_runtime_inmem-0.36.0.dev6 → langgraph_runtime_inmem-0.36.0.dev8}/langgraph_runtime_inmem/retry.py +0 -0
- {langgraph_runtime_inmem-0.36.0.dev6 → langgraph_runtime_inmem-0.36.0.dev8}/langgraph_runtime_inmem/routes.py +0 -0
- {langgraph_runtime_inmem-0.36.0.dev6 → langgraph_runtime_inmem-0.36.0.dev8}/langgraph_runtime_inmem/store.py +0 -0
- {langgraph_runtime_inmem-0.36.0.dev6 → langgraph_runtime_inmem-0.36.0.dev8}/pyproject.toml +0 -0
|
@@ -299,3 +299,50 @@ def Checkpointer(*args, unpack_hook=None, **kwargs):
|
|
|
299
299
|
|
|
300
300
|
|
|
301
301
|
__all__ = ["Checkpointer"]
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
def _nbytes(value: Any) -> int:
|
|
305
|
+
if isinstance(value, bytes | bytearray | memoryview):
|
|
306
|
+
return len(value)
|
|
307
|
+
if isinstance(value, tuple | list):
|
|
308
|
+
return sum(_nbytes(item) for item in value)
|
|
309
|
+
return 0
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
async def thread_storage(conn: Any, thread_id: str) -> dict[str, Any]:
|
|
313
|
+
"""Bytes a thread's checkpoints occupy in memory, per table and per channel.
|
|
314
|
+
|
|
315
|
+
Same shape as the postgres runtime's report, so one endpoint serves both.
|
|
316
|
+
"""
|
|
317
|
+
saver = Checkpointer()
|
|
318
|
+
by_channel: dict[str, dict[str, int]] = {}
|
|
319
|
+
for (tid, _ns, channel, _version), blob in list(saver.blobs.items()):
|
|
320
|
+
if tid != thread_id:
|
|
321
|
+
continue
|
|
322
|
+
entry = by_channel.setdefault(channel, {"versions": 0, "bytes": 0})
|
|
323
|
+
entry["versions"] += 1
|
|
324
|
+
entry["bytes"] += _nbytes(blob)
|
|
325
|
+
checkpoint_count = checkpoint_bytes = 0
|
|
326
|
+
if thread_id in saver.storage:
|
|
327
|
+
for checkpoints in saver.storage[thread_id].values():
|
|
328
|
+
for stored in checkpoints.values():
|
|
329
|
+
checkpoint_count += 1
|
|
330
|
+
checkpoint_bytes += _nbytes(stored)
|
|
331
|
+
write_count = write_bytes = 0
|
|
332
|
+
for (tid, _ns, _checkpoint_id), writes in list(saver.writes.items()):
|
|
333
|
+
if tid != thread_id:
|
|
334
|
+
continue
|
|
335
|
+
for write in writes.values():
|
|
336
|
+
write_count += 1
|
|
337
|
+
write_bytes += _nbytes(write)
|
|
338
|
+
channel_bytes = sum(entry["bytes"] for entry in by_channel.values())
|
|
339
|
+
return {
|
|
340
|
+
"total_bytes": checkpoint_bytes + channel_bytes + write_bytes,
|
|
341
|
+
"checkpoints": {"count": checkpoint_count, "bytes": checkpoint_bytes},
|
|
342
|
+
"channel_values": {
|
|
343
|
+
"count": sum(entry["versions"] for entry in by_channel.values()),
|
|
344
|
+
"bytes": channel_bytes,
|
|
345
|
+
"by_channel": by_channel,
|
|
346
|
+
},
|
|
347
|
+
"pending_writes": {"count": write_count, "bytes": write_bytes},
|
|
348
|
+
}
|
|
@@ -852,15 +852,21 @@ def _patch_interrupt(
|
|
|
852
852
|
|
|
853
853
|
In v0.4 and v0.5, interrupt_id is a property on the langgraph.types.Interrupt object,
|
|
854
854
|
so we reconstruct the type in order to access the id, with compatibility for the new
|
|
855
|
-
v0.6 interrupt format as well.
|
|
855
|
+
v0.6 interrupt format as well. `response_schema` is optional; older langgraph releases
|
|
856
|
+
do not set it.
|
|
856
857
|
"""
|
|
857
858
|
if USE_NEW_INTERRUPTS:
|
|
859
|
+
response_schema = (
|
|
860
|
+
interrupt.get("response_schema")
|
|
861
|
+
if isinstance(interrupt, dict)
|
|
862
|
+
else getattr(interrupt, "response_schema", None)
|
|
863
|
+
)
|
|
858
864
|
interrupt = Interrupt(**interrupt) if isinstance(interrupt, dict) else interrupt
|
|
859
865
|
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
"
|
|
863
|
-
|
|
866
|
+
patched: InterruptSchema = {"id": interrupt.id, "value": interrupt.value}
|
|
867
|
+
if response_schema is not None:
|
|
868
|
+
patched["response_schema"] = response_schema
|
|
869
|
+
return patched
|
|
864
870
|
else:
|
|
865
871
|
if isinstance(interrupt, dict):
|
|
866
872
|
# interrupt_id is a deprecated property on Interrupt and should not be used for initialization
|
|
@@ -13,15 +13,15 @@ wheels = [
|
|
|
13
13
|
|
|
14
14
|
[[package]]
|
|
15
15
|
name = "anyio"
|
|
16
|
-
version = "4.
|
|
16
|
+
version = "4.15.1"
|
|
17
17
|
source = { registry = "https://pypi.org/simple" }
|
|
18
18
|
dependencies = [
|
|
19
19
|
{ name = "idna" },
|
|
20
|
-
{ name = "typing-extensions", marker = "python_full_version < '3.
|
|
20
|
+
{ name = "typing-extensions", marker = "python_full_version < '3.15'" },
|
|
21
21
|
]
|
|
22
|
-
sdist = { url = "https://files.pythonhosted.org/packages/
|
|
22
|
+
sdist = { url = "https://files.pythonhosted.org/packages/a9/d2/f4d173e22df740bc37b1db102b386ba719b66e95b0f0d751f556b387e6d2/anyio-4.15.1.tar.gz", hash = "sha256:9f28306018cbd6d329e64a36d58256edff76dd996fe423bc957326e578b82a94", size = 276966, upload-time = "2026-09-05T10:42:39.44Z" }
|
|
23
23
|
wheels = [
|
|
24
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
24
|
+
{ url = "https://files.pythonhosted.org/packages/12/b8/4bd346e22b28902df4d651910f5242c28d84e4a5c2435ca5c3f797ed7e2e/anyio-4.15.1-py3-none-any.whl", hash = "sha256:6152fdbbf9a77fdec97731721bebf7c4c44f7c29b424b0065826173efc7ed101", size = 132079, upload-time = "2026-09-05T10:42:37.923Z" },
|
|
25
25
|
]
|
|
26
26
|
|
|
27
27
|
[[package]]
|
|
@@ -1013,11 +1013,11 @@ wheels = [
|
|
|
1013
1013
|
|
|
1014
1014
|
[[package]]
|
|
1015
1015
|
name = "typing-extensions"
|
|
1016
|
-
version = "4.
|
|
1016
|
+
version = "4.16.0"
|
|
1017
1017
|
source = { registry = "https://pypi.org/simple" }
|
|
1018
|
-
sdist = { url = "https://files.pythonhosted.org/packages/
|
|
1018
|
+
sdist = { url = "https://files.pythonhosted.org/packages/f6/cc/6253133b5bb138fc3306cebfbda2c520f545d36b5be2c7255cc528bb45d6/typing_extensions-4.16.0.tar.gz", hash = "sha256:dc983d19a509c94dba722ee6abd33940f7c05a89e243c47e907eb4db6f1a43e5", size = 113555, upload-time = "2026-07-02T08:40:05.92Z" }
|
|
1019
1019
|
wheels = [
|
|
1020
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1020
|
+
{ url = "https://files.pythonhosted.org/packages/49/d3/b8441a820a491ddfc024b0b0cf0393375b75ea13866d9c66727e54c2fc80/typing_extensions-4.16.0-py3-none-any.whl", hash = "sha256:481caa481374e813c1b176ada14e97f1f67a4539ce9cfeb3f350d78d6370c2e8", size = 45571, upload-time = "2026-07-02T08:40:04.659Z" },
|
|
1021
1021
|
]
|
|
1022
1022
|
|
|
1023
1023
|
[[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
|