langgraph-api 0.2.54__py3-none-any.whl → 0.2.56__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.
Potentially problematic release.
This version of langgraph-api might be problematic. Click here for more details.
- langgraph_api/__init__.py +1 -1
- langgraph_api/queue_entrypoint.py +27 -11
- {langgraph_api-0.2.54.dist-info → langgraph_api-0.2.56.dist-info}/METADATA +1 -1
- {langgraph_api-0.2.54.dist-info → langgraph_api-0.2.56.dist-info}/RECORD +7 -7
- {langgraph_api-0.2.54.dist-info → langgraph_api-0.2.56.dist-info}/WHEEL +0 -0
- {langgraph_api-0.2.54.dist-info → langgraph_api-0.2.56.dist-info}/entry_points.txt +0 -0
- {langgraph_api-0.2.54.dist-info → langgraph_api-0.2.56.dist-info}/licenses/LICENSE +0 -0
langgraph_api/__init__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.2.
|
|
1
|
+
__version__ = "0.2.56"
|
|
@@ -10,11 +10,13 @@ if not (
|
|
|
10
10
|
truststore.inject_into_ssl() # noqa: F401
|
|
11
11
|
|
|
12
12
|
import asyncio
|
|
13
|
+
import contextlib
|
|
13
14
|
import http.server
|
|
14
15
|
import json
|
|
15
16
|
import logging.config
|
|
16
17
|
import os
|
|
17
18
|
import pathlib
|
|
19
|
+
import signal
|
|
18
20
|
|
|
19
21
|
import structlog
|
|
20
22
|
import uvloop
|
|
@@ -60,25 +62,39 @@ async def entrypoint():
|
|
|
60
62
|
|
|
61
63
|
lg_logging.set_logging_context({"entrypoint": "python-queue"})
|
|
62
64
|
tasks: set[asyncio.Task] = set()
|
|
63
|
-
# start simple http server for health checks
|
|
64
65
|
tasks.add(asyncio.create_task(healthcheck_server()))
|
|
65
|
-
# start queue and associated tasks
|
|
66
66
|
async with lifespan(None, with_cron_scheduler=False, taskset=tasks):
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
67
|
+
await asyncio.gather(*tasks)
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
async def main():
|
|
71
|
+
"""Run the queue entrypoint and shut down gracefully on SIGTERM/SIGINT."""
|
|
72
|
+
loop = asyncio.get_running_loop()
|
|
73
|
+
stop_event = asyncio.Event()
|
|
74
|
+
|
|
75
|
+
def _handle_signal() -> None:
|
|
76
|
+
logger.warning("Received termination signal, initiating graceful shutdown")
|
|
77
|
+
stop_event.set()
|
|
78
|
+
|
|
79
|
+
try:
|
|
80
|
+
loop.add_signal_handler(signal.SIGTERM, _handle_signal)
|
|
81
|
+
except (NotImplementedError, RuntimeError):
|
|
82
|
+
signal.signal(signal.SIGTERM, lambda *_: _handle_signal())
|
|
83
|
+
|
|
84
|
+
entry_task = asyncio.create_task(entrypoint())
|
|
85
|
+
await stop_event.wait()
|
|
86
|
+
|
|
87
|
+
logger.warning("Cancelling queue entrypoint task")
|
|
88
|
+
entry_task.cancel()
|
|
89
|
+
with contextlib.suppress(asyncio.CancelledError):
|
|
90
|
+
await entry_task
|
|
72
91
|
|
|
73
92
|
|
|
74
93
|
if __name__ == "__main__":
|
|
75
|
-
# set up logging
|
|
76
94
|
with open(pathlib.Path(__file__).parent.parent / "logging.json") as file:
|
|
77
95
|
loaded_config = json.load(file)
|
|
78
96
|
logging.config.dictConfig(loaded_config)
|
|
79
97
|
|
|
80
|
-
# set up uvloop
|
|
81
98
|
uvloop.install()
|
|
82
99
|
|
|
83
|
-
|
|
84
|
-
asyncio.run(entrypoint())
|
|
100
|
+
asyncio.run(main())
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
langgraph_api/__init__.py,sha256=
|
|
1
|
+
langgraph_api/__init__.py,sha256=yuhEwVPZG_uwEXVduMxOuyth-d2aFtmKNM7h6XPNHtM,23
|
|
2
2
|
langgraph_api/asgi_transport.py,sha256=eqifhHxNnxvI7jJqrY1_8RjL4Fp9NdN4prEub2FWBt8,5091
|
|
3
3
|
langgraph_api/asyncio.py,sha256=Odnc6mAJIGF3eFWT8Xcrg2Zam7FwzXkfCWEHaXfrzQQ,9371
|
|
4
4
|
langgraph_api/cli.py,sha256=9Ou3tGDDY_VVLt5DFle8UviJdpI4ZigC5hElYvq2-To,14519
|
|
@@ -11,7 +11,7 @@ langgraph_api/http.py,sha256=gYbxxjY8aLnsXeJymcJ7G7Nj_yToOGpPYQqmZ1_ggfA,5240
|
|
|
11
11
|
langgraph_api/logging.py,sha256=1BXELwUBY8gZeOWCYElbBu_GyHLM2jjlDVJznlekqvQ,4268
|
|
12
12
|
langgraph_api/metadata.py,sha256=Gx0b6YszLRjdWLDVN8OcVgC_YYQG_nQitPfUfgQx1w8,4648
|
|
13
13
|
langgraph_api/patch.py,sha256=Dgs0PXHytekX4SUL6KsjjN0hHcOtGLvv1GRGbh6PswU,1408
|
|
14
|
-
langgraph_api/queue_entrypoint.py,sha256=
|
|
14
|
+
langgraph_api/queue_entrypoint.py,sha256=rW4-OEsWwBsLLp6U0P-de-I0tR3gPZaeBKWB3LRrTr0,2923
|
|
15
15
|
langgraph_api/route.py,sha256=4VBkJMeusfiZtLzyUaKm1HwLHTq0g15y2CRiRhM6xyA,4773
|
|
16
16
|
langgraph_api/schema.py,sha256=2711t4PIBk5dky4gmMndrTRC9CVvAgH47C9FKDxhkBo,5444
|
|
17
17
|
langgraph_api/serde.py,sha256=8fQXg7T7RVUqj_jgOoSOJrWVpQDW0qJKjAjSsEhPHo4,4803
|
|
@@ -86,8 +86,8 @@ langgraph_runtime/store.py,sha256=7mowndlsIroGHv3NpTSOZDJR0lCuaYMBoTnTrewjslw,11
|
|
|
86
86
|
LICENSE,sha256=ZPwVR73Biwm3sK6vR54djCrhaRiM4cAD2zvOQZV8Xis,3859
|
|
87
87
|
logging.json,sha256=3RNjSADZmDq38eHePMm1CbP6qZ71AmpBtLwCmKU9Zgo,379
|
|
88
88
|
openapi.json,sha256=wrJup7sCRlZXTRagjzGZ7474U1wma4ZzYTkkninrT6M,141875
|
|
89
|
-
langgraph_api-0.2.
|
|
90
|
-
langgraph_api-0.2.
|
|
91
|
-
langgraph_api-0.2.
|
|
92
|
-
langgraph_api-0.2.
|
|
93
|
-
langgraph_api-0.2.
|
|
89
|
+
langgraph_api-0.2.56.dist-info/METADATA,sha256=wfCknYuOUBNVrO4AM6m33ekJis6bPutLf-EWFDWpPTw,3891
|
|
90
|
+
langgraph_api-0.2.56.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
91
|
+
langgraph_api-0.2.56.dist-info/entry_points.txt,sha256=hGedv8n7cgi41PypMfinwS_HfCwA7xJIfS0jAp8htV8,78
|
|
92
|
+
langgraph_api-0.2.56.dist-info/licenses/LICENSE,sha256=ZPwVR73Biwm3sK6vR54djCrhaRiM4cAD2zvOQZV8Xis,3859
|
|
93
|
+
langgraph_api-0.2.56.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|