langgraph-api 0.0.47__py3-none-any.whl → 0.0.48__py3-none-any.whl

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_api/__init__.py CHANGED
@@ -1 +1 @@
1
- __version__ = "0.0.47"
1
+ __version__ = "0.0.46"
@@ -5,7 +5,6 @@ import structlog
5
5
  from starlette.requests import ClientDisconnect
6
6
  from starlette.types import Message, Receive, Scope, Send
7
7
 
8
- from langgraph_api.asyncio import create_task
9
8
  from langgraph_api.logging import LOG_JSON
10
9
 
11
10
  asgi = structlog.stdlib.get_logger("asgi")
@@ -21,6 +20,12 @@ class AccessLoggerMiddleware:
21
20
  ) -> None:
22
21
  self.app = app
23
22
  self.logger = logger
23
+ if hasattr(logger, "isEnabledFor"):
24
+ self.debug_enabled = self.logger.isEnabledFor(logging.DEBUG)
25
+ elif hasattr(logger, "is_enabled_for"):
26
+ self.debug_enabled = self.logger.is_enabled_for(logging.DEBUG)
27
+ else:
28
+ self.debug_enabled = False
24
29
 
25
30
  async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None:
26
31
  if scope["type"] != "http" or (LOG_JSON and scope.get("path") in PATHS_IGNORE):
@@ -29,7 +34,7 @@ class AccessLoggerMiddleware:
29
34
  loop = asyncio.get_event_loop()
30
35
  info = {"response": {}}
31
36
 
32
- if self.logger.isEnabledFor(logging.DEBUG):
37
+ if self.debug_enabled:
33
38
 
34
39
  async def inner_receive() -> Message:
35
40
  message = await receive()
@@ -61,20 +66,18 @@ class AccessLoggerMiddleware:
61
66
  finally:
62
67
  info["end_time"] = loop.time()
63
68
  latency = int((info["end_time"] - info["start_time"]) * 1_000)
64
- create_task(
65
- self.logger.ainfo(
66
- f"{scope.get('method')} {scope.get('path')} {info['response'].get('status')} {latency}ms",
67
- method=scope.get("method"),
68
- path=scope.get("path"),
69
- status=info["response"].get("status"),
70
- latency_ms=latency,
71
- route=scope.get("route"),
72
- path_params=scope.get("path_params"),
73
- query_string=scope.get("query_string").decode(),
74
- proto=scope.get("http_version"),
75
- req_header=_headers_to_dict(scope.get("headers")),
76
- res_header=_headers_to_dict(info["response"].get("headers")),
77
- )
69
+ self.logger.info(
70
+ f"{scope.get('method')} {scope.get('path')} {info['response'].get('status')} {latency}ms",
71
+ method=scope.get("method"),
72
+ path=scope.get("path"),
73
+ status=info["response"].get("status"),
74
+ latency_ms=latency,
75
+ route=scope.get("route"),
76
+ path_params=scope.get("path_params"),
77
+ query_string=scope.get("query_string").decode(),
78
+ proto=scope.get("http_version"),
79
+ req_header=_headers_to_dict(scope.get("headers")),
80
+ res_header=_headers_to_dict(info["response"].get("headers")),
78
81
  )
79
82
 
80
83
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: langgraph-api
3
- Version: 0.0.47
3
+ Version: 0.0.48
4
4
  Summary:
5
5
  License: Elastic-2.0
6
6
  Author: Nuno Campos
@@ -1,5 +1,5 @@
1
1
  LICENSE,sha256=ZPwVR73Biwm3sK6vR54djCrhaRiM4cAD2zvOQZV8Xis,3859
2
- langgraph_api/__init__.py,sha256=OkbXUm6WCcFd54358Y0HZk3Aq5hLc0sK6xgxJ6RmT5M,23
2
+ langgraph_api/__init__.py,sha256=WvtDrm5o4jAYjOF-kumI_Il7bjdj2Nr-QuEWD_sgdXQ,23
3
3
  langgraph_api/api/__init__.py,sha256=qNcg8QJydef0gM-vYJlxITMRZw-9r1vw8zqm2raqqYE,5493
4
4
  langgraph_api/api/assistants.py,sha256=WwaBtx1MpGn9gdJ8P9fkorJHMVrJKHt1nvtw0OCZcdw,14353
5
5
  langgraph_api/api/mcp.py,sha256=KbR19dtFCpJEiKYj3IfepAuJij8YZVELuVp7JY_yu_o,13754
@@ -67,7 +67,7 @@ langgraph_api/lifespan.py,sha256=SfVZj0SQdsIfYwvN5s4dfxGMb7MMlGe40DghCGDFaTQ,291
67
67
  langgraph_api/logging.py,sha256=JJIzbNIgLCN6ClQ3tA-Mm5ffuBGvpRDSZsEvnIlsuu4,3693
68
68
  langgraph_api/metadata.py,sha256=bAeN3NwibBuXUVPjOEbEUJMnhUXe_VdTGw508VNeav4,3655
69
69
  langgraph_api/middleware/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
70
- langgraph_api/middleware/http_logger.py,sha256=yuFPNFIWwn-4AE1CogBfWlo8KytzywLi_Bd4ccsyVQE,3150
70
+ langgraph_api/middleware/http_logger.py,sha256=aj4mdisRobFePkD3Iy6-w_Mujwx4TQRaEhPvSd6HgLk,3284
71
71
  langgraph_api/middleware/private_network.py,sha256=eYgdyU8AzU2XJu362i1L8aSFoQRiV7_aLBPw7_EgeqI,2111
72
72
  langgraph_api/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
73
73
  langgraph_api/models/run.py,sha256=85-pyyvosFAot8WrWl2QjCje-2c4lhattYvoAEMqztA,11000
@@ -92,14 +92,14 @@ langgraph_storage/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU
92
92
  langgraph_storage/checkpoint.py,sha256=Qq0y6vdh27qdF3h5nOLT5CcX9Rj2bcFqkVOMeCaGoK4,4036
93
93
  langgraph_storage/database.py,sha256=sZjZvMcvbr_6dX0d1YrYEccVuQozIfkiWt8bdlXGVYU,5849
94
94
  langgraph_storage/inmem_stream.py,sha256=LjJSAxsh_E0ywqEMzdWJk8Hy_Jn9oQByzycss-fANng,3264
95
- langgraph_storage/ops.py,sha256=S2qXgfyuCr5qkKLqIV-kZNRK924bBSLZ2qdLtExfi-M,75939
95
+ langgraph_storage/ops.py,sha256=ksJPrjdFRXRGYffrdLvk06Ec-OT1E_Q6qB1_rbdF0w8,75800
96
96
  langgraph_storage/queue.py,sha256=IGjzCzYaGhbR9_Y37p1Hbd5uQkN9_IGzYkT_5lcPU54,7595
97
97
  langgraph_storage/retry.py,sha256=XmldOP4e_H5s264CagJRVnQMDFcEJR_dldVR1Hm5XvM,763
98
98
  langgraph_storage/store.py,sha256=JB9jZ87GE19MVN9wgl3-esgR2eIkeipws9q6qsPWkgc,3399
99
99
  logging.json,sha256=3RNjSADZmDq38eHePMm1CbP6qZ71AmpBtLwCmKU9Zgo,379
100
100
  openapi.json,sha256=YW4ND-N3adriEoNwxw7UD9endO2xUZoodCtwVIfa2dU,132261
101
- langgraph_api-0.0.47.dist-info/LICENSE,sha256=ZPwVR73Biwm3sK6vR54djCrhaRiM4cAD2zvOQZV8Xis,3859
102
- langgraph_api-0.0.47.dist-info/METADATA,sha256=IO4hwBirD3f4JqdFNa0B6V1TsB-QXhD0SlWYYRbce6Y,4165
103
- langgraph_api-0.0.47.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
104
- langgraph_api-0.0.47.dist-info/entry_points.txt,sha256=3EYLgj89DfzqJHHYGxPH4A_fEtClvlRbWRUHaXO7hj4,77
105
- langgraph_api-0.0.47.dist-info/RECORD,,
101
+ langgraph_api-0.0.48.dist-info/LICENSE,sha256=ZPwVR73Biwm3sK6vR54djCrhaRiM4cAD2zvOQZV8Xis,3859
102
+ langgraph_api-0.0.48.dist-info/METADATA,sha256=0Bi2FktyQZbXA3aE3Q1YDCmaGh0Vwiswtk_x1xSUtz0,4165
103
+ langgraph_api-0.0.48.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
104
+ langgraph_api-0.0.48.dist-info/entry_points.txt,sha256=3EYLgj89DfzqJHHYGxPH4A_fEtClvlRbWRUHaXO7hj4,77
105
+ langgraph_api-0.0.48.dist-info/RECORD,,
langgraph_storage/ops.py CHANGED
@@ -4,7 +4,6 @@ import asyncio
4
4
  import base64
5
5
  import copy
6
6
  import json
7
- import logging
8
7
  import uuid
9
8
  from collections import defaultdict
10
9
  from collections.abc import AsyncIterator, Sequence
@@ -1915,7 +1914,6 @@ class Runs(Authenticated):
1915
1914
  ctx: Auth.types.BaseAuthContext | None = None,
1916
1915
  ) -> AsyncIterator[tuple[bytes, bytes]]:
1917
1916
  """Stream the run output."""
1918
- log = logger.isEnabledFor(logging.DEBUG)
1919
1917
  queue = (
1920
1918
  stream_mode
1921
1919
  if isinstance(stream_mode, asyncio.Queue)
@@ -1954,13 +1952,12 @@ class Runs(Authenticated):
1954
1952
  else:
1955
1953
  # Extract mode from topic
1956
1954
  yield topic[len_prefix:], data
1957
- if log:
1958
- await logger.adebug(
1959
- "Streamed run event",
1960
- run_id=str(run_id),
1961
- stream_mode=topic[len_prefix:],
1962
- data=data,
1963
- )
1955
+ logger.debug(
1956
+ "Streamed run event",
1957
+ run_id=str(run_id),
1958
+ stream_mode=topic[len_prefix:],
1959
+ data=data,
1960
+ )
1964
1961
  except TimeoutError:
1965
1962
  # Check if the run is still pending
1966
1963
  run_iter = await Runs.get(