langgraph-api 0.13.0.dev2__py3-none-any.whl → 0.13.0.dev4__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.13.0.dev2"
1
+ __version__ = "0.13.0.dev4"
@@ -311,29 +311,30 @@ async def get_assistant_graph(
311
311
  configurable = config.setdefault("configurable", {})
312
312
  configurable.update(get_configurable_headers(request.headers))
313
313
 
314
+ xray: bool | int = False
315
+ xray_query = request.query_params.get("xray")
316
+ if xray_query:
317
+ if xray_query in ("true", "True"):
318
+ xray = True
319
+ elif xray_query in ("false", "False"):
320
+ xray = False
321
+ else:
322
+ try:
323
+ xray = int(xray_query)
324
+ except ValueError:
325
+ raise HTTPException(422, detail="Invalid xray value") from None
326
+
327
+ if xray <= 0:
328
+ raise HTTPException(422, detail="Invalid xray value") from None
329
+
314
330
  async with get_graph(
315
331
  assistant["graph_id"],
316
332
  config,
317
333
  checkpointer=(await api_checkpointer.get_checkpointer()),
318
334
  store=(await api_store.get_store()),
319
335
  access_context="assistants.read",
336
+ use_langgraph_runtime=bool(xray),
320
337
  ) as graph:
321
- xray: bool | int = False
322
- xray_query = request.query_params.get("xray")
323
- if xray_query:
324
- if xray_query in ("true", "True"):
325
- xray = True
326
- elif xray_query in ("false", "False"):
327
- xray = False
328
- else:
329
- try:
330
- xray = int(xray_query)
331
- except ValueError:
332
- raise HTTPException(422, detail="Invalid xray value") from None
333
-
334
- if xray <= 0:
335
- raise HTTPException(422, detail="Invalid xray value") from None
336
-
337
338
  if isinstance(graph, BaseRemotePregel):
338
339
  drawable_graph = await graph.fetch_graph(xray=xray)
339
340
  json_graph = drawable_graph.to_json()
langgraph_api/graph.py CHANGED
@@ -357,6 +357,7 @@ async def get_graph(
357
357
  access_context: AccessContext,
358
358
  run_id: str | None = None,
359
359
  context: Any | None = None,
360
+ use_langgraph_runtime: bool = False,
360
361
  ) -> AsyncIterator[Pregel]:
361
362
  """Return the runnable."""
362
363
  from langgraph_api.utils import config as lg_config # noqa: PLC0415
@@ -373,7 +374,13 @@ async def get_graph(
373
374
  CONFIG_KEY_RUNTIME,
374
375
  )
375
376
 
376
- config["configurable"][CONFIG_KEY_RUNTIME] = server_runtime
377
+ if use_langgraph_runtime:
378
+ # xray draw calls runtime.override(), which the SDK ServerRuntime lacks (LSD-1713).
379
+ from langgraph.runtime import Runtime # noqa: PLC0415
380
+
381
+ config["configurable"][CONFIG_KEY_RUNTIME] = Runtime(store=store)
382
+ else:
383
+ config["configurable"][CONFIG_KEY_RUNTIME] = server_runtime
377
384
  elif store is not None:
378
385
  from langgraph.constants import CONFIG_KEY_STORE # noqa: PLC0415
379
386
 
@@ -19,7 +19,6 @@ from contextlib import suppress
19
19
 
20
20
  import structlog
21
21
 
22
- from langgraph_api.api.meta import meta_pool_stats
23
22
  from langgraph_api.utils.errors import GraphLoadError, HealthServerStartupError
24
23
  from langgraph_api.utils.network import format_hostport, normalize_host
25
24
  from langgraph_runtime import lifespan
@@ -72,7 +71,7 @@ async def health_and_metrics_server():
72
71
  from starlette.routing import Mount, Route # noqa: PLC0415
73
72
 
74
73
  from langgraph_api import config as lc_config # noqa: PLC0415
75
- from langgraph_api.api.meta import METRICS_FORMATS # noqa: PLC0415
74
+ from langgraph_api.api.meta import METRICS_FORMATS, meta_pool_stats # noqa: PLC0415
76
75
 
77
76
  port = int(os.getenv("PORT", "8080"))
78
77
  # Not in public docs: LANGGRAPH_SERVER_HOST is internal
@@ -298,9 +297,14 @@ async def main(entrypoint_name: str = "python-queue"):
298
297
 
299
298
 
300
299
  if __name__ == "__main__":
300
+ # Set before any langgraph_api.api import. That package's __init__ pulls in
301
+ # auth.middleware, which builds the auth backend at import time. Custom JS
302
+ # auth then imports js.remote and freezes REMOTE_PORT from this flag; if we
303
+ # set it too late the colocated queue worker binds 5555 instead of 5565.
301
304
  from langgraph_api import config
302
305
 
303
306
  config.IS_QUEUE_ENTRYPOINT = True
307
+
304
308
  with open(pathlib.Path(__file__).parent.parent / "logging.json") as file:
305
309
  loaded_config = json.load(file)
306
310
  logging.config.dictConfig(loaded_config)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: langgraph-api
3
- Version: 0.13.0.dev2
3
+ Version: 0.13.0.dev4
4
4
  Author-email: Will Fu-Hinthorn <will@langchain.dev>, Josh Rogers <josh@langchain.dev>, Parker Rule <parker@langchain.dev>
5
5
  License: Elastic-2.0
6
6
  License-File: LICENSE
@@ -1,4 +1,4 @@
1
- langgraph_api/__init__.py,sha256=K14HGkNnmOGU0PK4HQ1-QW1qAl1RXZGaf-NIfPJj6VM,28
1
+ langgraph_api/__init__.py,sha256=IJ6T00gqMUWJ3oiiXB2xJKESlJc2_Z4RdXtAjpbSYzI,28
2
2
  langgraph_api/_factory_utils.py,sha256=_FqW0olMu2PGLsnRq0ylt3a4jDCe12YIFHExMXI6Nyo,5976
3
3
  langgraph_api/asgi_transport.py,sha256=XApY3lIWBZTMbbsl8dDJzl0cLGirmAGE0SifqZUnXvs,11896
4
4
  langgraph_api/asyncio.py,sha256=smqyAoO9nIyPPQRw1IVSCh85fwoZP4PEo-5dDhxGruc,10676
@@ -8,7 +8,7 @@ langgraph_api/command.py,sha256=d-k8h6H4ix1n7fSZ-Zb01NbSkEyqrD6cMKfDFXEIYEw,821
8
8
  langgraph_api/cron_scheduler.py,sha256=OwFzCwD86pfMNpfm9Z8bBS_WY9bBfDxGnq8_7wXurdA,6016
9
9
  langgraph_api/errors.py,sha256=zlMW99wAzNkz2xfik-HMkl_wMqmRFvs1j8V-_DZbAUc,2553
10
10
  langgraph_api/feature_flags.py,sha256=P7yQ9jXMHO3dPWv51iWGAVrPg3LbR9m4aCT_7t1UtZw,2624
11
- langgraph_api/graph.py,sha256=j8MxvABzz1XPmC_2rrCuSc_LcVB8t_yV6H8dYWA_yYU,38048
11
+ langgraph_api/graph.py,sha256=o--PRRg986nR2HVii_tgbGba9neiNFQ0wu_y5M9joJA,38403
12
12
  langgraph_api/http.py,sha256=7hPxKbj-xoAKcm7iucBpT5nM_hXOgGVCPbBsCD693Cw,6977
13
13
  langgraph_api/http_metrics.py,sha256=etxbZNmYxdb58DVLNkHP7S-N6njXPTiQh2OWKMaIZi8,5336
14
14
  langgraph_api/http_metrics_utils.py,sha256=sjxF7SYGTzY0Wz_G0dzatsYNnWr31S6ujej4JmBG2yo,866
@@ -18,7 +18,7 @@ langgraph_api/metrics_collector.py,sha256=gMLHL18rJyYl985AOmu9eH7W1ttdRdkPHzeycz
18
18
  langgraph_api/metrics_otlp.py,sha256=B2J7RyIng524MRjSOp0yBNKT5FZtq4XwUYH0fcoCk8U,29652
19
19
  langgraph_api/otel_context.py,sha256=DWFwW4Yu88QY4W2J0IRcURR450Th9J2DupvDDkSkMBA,7166
20
20
  langgraph_api/patch.py,sha256=ViUknYvyQWS6y0f5XuaEoci2qB_mQv8vZl-oaUxsI6M,1448
21
- langgraph_api/queue_entrypoint.py,sha256=-9YnY_GhmDxEiGCc3k-7UqRKK_M3dPriits2iGgYlgU,11327
21
+ langgraph_api/queue_entrypoint.py,sha256=1pb7kUWLbc1jIElZ2KTronREFXh3Vq0Sx4_feZX-YxE,11610
22
22
  langgraph_api/release_tags.py,sha256=Dd2L2Mdh7c5D7RhFvdGCXROLH3WI1QKXbEqgjITFFoQ,9437
23
23
  langgraph_api/route.py,sha256=_KE8A8Q-J-QfqjGlyM2Kc6n5cirmgt8xmI5-pI8kVEE,8837
24
24
  langgraph_api/schema.py,sha256=4VhH4V9RmvBqO9MMPbaKk80PUQrPFyTMjDTT8nAZZ6w,15257
@@ -41,7 +41,7 @@ langgraph_api/_checkpointer/_adapter.py,sha256=1jJi0vXoNKeCwNP26W8bmYrwe-fOWFqep
41
41
  langgraph_api/_checkpointer/protocol.py,sha256=udgYKMNtKWG_eLDwYkHXV3b2bZLZg8Rsfm3fjkhU-rU,3635
42
42
  langgraph_api/api/__init__.py,sha256=Zu1ew3dxYZu7cLRAjn-6HcYmtuQBdihlVFMKMJ77Y3c,9269
43
43
  langgraph_api/api/a2a.py,sha256=9Ylvywxi-qRnwNx6pEg9davUJHEdzMifsSUI-il_jb4,98001
44
- langgraph_api/api/assistants.py,sha256=ZYK2B4IFaIMvkfklmmQgrqhaI55M7k6QKb2cETnVP7A,20900
44
+ langgraph_api/api/assistants.py,sha256=y_39ur-5EADCNU4eCk9WwinPI1dvImcMQrC0tSkxdQg,20886
45
45
  langgraph_api/api/event_streaming.py,sha256=jvoBp5qHI92JJHsx4f9LEpb0i0VE31G_qFhS5JQWtlA,17809
46
46
  langgraph_api/api/meta.py,sha256=5s017GfMs-Ghq6Z5K6yW4UjbVFzCsmeXKn4UEJmfs98,4757
47
47
  langgraph_api/api/openapi.py,sha256=Zkdlb9mjrQyHro1TtrDIWVuaBDovxx-uGWJ1fZMOg54,12604
@@ -236,8 +236,8 @@ langgraph_grpc_common/proto/store_pb2.py,sha256=uAYM7OcdEOK12iRcPYihC2suSeCo_Qdb
236
236
  langgraph_grpc_common/proto/store_pb2.pyi,sha256=_dcxyxV8moR6H67qU42r2h2p_Ub-PZSHs3OoS9KMdSY,27782
237
237
  langgraph_grpc_common/proto/store_pb2_grpc.py,sha256=wSD65QgFkYTkPTHcf7VhyI2FQ7UH_RgIf3vQW3VYlsM,3324
238
238
  langgraph_grpc_common/proto/store_pb2_grpc.pyi,sha256=oS1h2cDoq2OjyM8xazcmc8LwRDC5oCAD0zto2QUmPQw,2027
239
- langgraph_api-0.13.0.dev2.dist-info/METADATA,sha256=wqjQf0UE4z_W9VeFDWHPRj_mvMM1VLrbxnlQrkpDdjo,4630
240
- langgraph_api-0.13.0.dev2.dist-info/WHEEL,sha256=lCkmxWfQsSc9CfIClYeavTdQeEX2toPqufh9gI35EQA,87
241
- langgraph_api-0.13.0.dev2.dist-info/entry_points.txt,sha256=hGedv8n7cgi41PypMfinwS_HfCwA7xJIfS0jAp8htV8,78
242
- langgraph_api-0.13.0.dev2.dist-info/licenses/LICENSE,sha256=ZPwVR73Biwm3sK6vR54djCrhaRiM4cAD2zvOQZV8Xis,3859
243
- langgraph_api-0.13.0.dev2.dist-info/RECORD,,
239
+ langgraph_api-0.13.0.dev4.dist-info/METADATA,sha256=syKGu0adKu06xPM2VhtFeJKtPVwqWyMYbzj8ew8W9eY,4630
240
+ langgraph_api-0.13.0.dev4.dist-info/WHEEL,sha256=lCkmxWfQsSc9CfIClYeavTdQeEX2toPqufh9gI35EQA,87
241
+ langgraph_api-0.13.0.dev4.dist-info/entry_points.txt,sha256=hGedv8n7cgi41PypMfinwS_HfCwA7xJIfS0jAp8htV8,78
242
+ langgraph_api-0.13.0.dev4.dist-info/licenses/LICENSE,sha256=ZPwVR73Biwm3sK6vR54djCrhaRiM4cAD2zvOQZV8Xis,3859
243
+ langgraph_api-0.13.0.dev4.dist-info/RECORD,,