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.
Files changed (18) hide show
  1. {langgraph_runtime_inmem-0.36.0.dev6 → langgraph_runtime_inmem-0.36.0.dev8}/PKG-INFO +1 -1
  2. {langgraph_runtime_inmem-0.36.0.dev6 → langgraph_runtime_inmem-0.36.0.dev8}/langgraph_runtime_inmem/__init__.py +1 -1
  3. {langgraph_runtime_inmem-0.36.0.dev6 → langgraph_runtime_inmem-0.36.0.dev8}/langgraph_runtime_inmem/checkpoint.py +47 -0
  4. {langgraph_runtime_inmem-0.36.0.dev6 → langgraph_runtime_inmem-0.36.0.dev8}/langgraph_runtime_inmem/ops.py +11 -5
  5. {langgraph_runtime_inmem-0.36.0.dev6 → langgraph_runtime_inmem-0.36.0.dev8}/uv.lock +7 -7
  6. {langgraph_runtime_inmem-0.36.0.dev6 → langgraph_runtime_inmem-0.36.0.dev8}/.gitignore +0 -0
  7. {langgraph_runtime_inmem-0.36.0.dev6 → langgraph_runtime_inmem-0.36.0.dev8}/Makefile +0 -0
  8. {langgraph_runtime_inmem-0.36.0.dev6 → langgraph_runtime_inmem-0.36.0.dev8}/README.md +0 -0
  9. {langgraph_runtime_inmem-0.36.0.dev6 → langgraph_runtime_inmem-0.36.0.dev8}/langgraph_runtime_inmem/_persistence.py +0 -0
  10. {langgraph_runtime_inmem-0.36.0.dev6 → langgraph_runtime_inmem-0.36.0.dev8}/langgraph_runtime_inmem/database.py +0 -0
  11. {langgraph_runtime_inmem-0.36.0.dev6 → langgraph_runtime_inmem-0.36.0.dev8}/langgraph_runtime_inmem/inmem_stream.py +0 -0
  12. {langgraph_runtime_inmem-0.36.0.dev6 → langgraph_runtime_inmem-0.36.0.dev8}/langgraph_runtime_inmem/lifespan.py +0 -0
  13. {langgraph_runtime_inmem-0.36.0.dev6 → langgraph_runtime_inmem-0.36.0.dev8}/langgraph_runtime_inmem/metrics.py +0 -0
  14. {langgraph_runtime_inmem-0.36.0.dev6 → langgraph_runtime_inmem-0.36.0.dev8}/langgraph_runtime_inmem/queue.py +0 -0
  15. {langgraph_runtime_inmem-0.36.0.dev6 → langgraph_runtime_inmem-0.36.0.dev8}/langgraph_runtime_inmem/retry.py +0 -0
  16. {langgraph_runtime_inmem-0.36.0.dev6 → langgraph_runtime_inmem-0.36.0.dev8}/langgraph_runtime_inmem/routes.py +0 -0
  17. {langgraph_runtime_inmem-0.36.0.dev6 → langgraph_runtime_inmem-0.36.0.dev8}/langgraph_runtime_inmem/store.py +0 -0
  18. {langgraph_runtime_inmem-0.36.0.dev6 → langgraph_runtime_inmem-0.36.0.dev8}/pyproject.toml +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: langgraph-runtime-inmem
3
- Version: 0.36.0.dev6
3
+ Version: 0.36.0.dev8
4
4
  Summary: Inmem implementation for the LangGraph API server.
5
5
  Author-email: Will Fu-Hinthorn <will@langchain.dev>
6
6
  License: Elastic-2.0
@@ -10,7 +10,7 @@ from langgraph_runtime_inmem import (
10
10
  store,
11
11
  )
12
12
 
13
- __version__ = "0.36.0.dev6"
13
+ __version__ = "0.36.0.dev8"
14
14
  __all__ = [
15
15
  "ops",
16
16
  "database",
@@ -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
- return {
861
- "id": interrupt.id,
862
- "value": interrupt.value,
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.14.0"
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.13'" },
20
+ { name = "typing-extensions", marker = "python_full_version < '3.15'" },
21
21
  ]
22
- sdist = { url = "https://files.pythonhosted.org/packages/1c/b5/001890774a9552aff22502b8da382593109ce0c95314abaebbb116567545/anyio-4.14.0.tar.gz", hash = "sha256:b47c1f9ccf73e67021df785332508f99379c68fa7d0684e8e3492cb1d4b23f89", size = 253586, upload-time = "2026-06-15T22:00:49.021Z" }
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/ba/16/9826f089383c593cdfc4a6e5aca94d9e91ae1692c57af82c3b2aa5e810f7/anyio-4.14.0-py3-none-any.whl", hash = "sha256:dd9b7a2a9799ed6552fde617b2c5df02b7fdd7d88392fc48101e51bae46164d9", size = 123506, upload-time = "2026-06-15T22:00:47.595Z" },
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.15.0"
1016
+ version = "4.16.0"
1017
1017
  source = { registry = "https://pypi.org/simple" }
1018
- sdist = { url = "https://files.pythonhosted.org/packages/72/94/1a15dd82efb362ac84269196e94cf00f187f7ed21c242792a923cdb1c61f/typing_extensions-4.15.0.tar.gz", hash = "sha256:0cea48d173cc12fa28ecabc3b837ea3cf6f38c6d1136f85cbaaf598984861466", size = 109391, upload-time = "2025-08-25T13:49:26.313Z" }
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/18/67/36e9267722cc04a6b9f15c7f3441c2363321a3ea07da7ae0c0707beb2a9c/typing_extensions-4.15.0-py3-none-any.whl", hash = "sha256:f0fa19c6845758ab08074a0cfa8b7aecb71c999ca73d62883bc25cc018c4e548", size = 44614, upload-time = "2025-08-25T13:49:24.86Z" },
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]]