langgraph-api 0.2.83__py3-none-any.whl → 0.2.85__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 CHANGED
@@ -1 +1 @@
1
- __version__ = "0.2.83"
1
+ __version__ = "0.2.85"
langgraph_api/api/meta.py CHANGED
@@ -1,3 +1,4 @@
1
+ import langgraph.version
1
2
  from starlette.responses import JSONResponse, PlainTextResponse
2
3
 
3
4
  from langgraph_api import __version__, config, metadata
@@ -16,6 +17,7 @@ async def meta_info(request: ApiRequest):
16
17
  return JSONResponse(
17
18
  {
18
19
  "version": __version__,
20
+ "langgraph_py_version": langgraph.version.__version__,
19
21
  "flags": {
20
22
  "assistants": True,
21
23
  "crons": plus and config.FF_CRONS_ENABLED,
langgraph_api/api/runs.py CHANGED
@@ -172,6 +172,7 @@ async def wait_run(request: ApiRequest):
172
172
  """Create a run, wait for the output."""
173
173
  thread_id = request.path_params["thread_id"]
174
174
  payload = await request.json(RunCreateStateful)
175
+ on_disconnect = payload.get("on_disconnect", "continue")
175
176
  run_id = uuid6()
176
177
  sub = asyncio.create_task(Runs.Stream.subscribe(run_id))
177
178
 
@@ -197,7 +198,10 @@ async def wait_run(request: ApiRequest):
197
198
  vchunk: bytes | None = None
198
199
  async with aclosing(
199
200
  Runs.Stream.join(
200
- run["run_id"], thread_id=run["thread_id"], stream_mode=await sub
201
+ run["run_id"],
202
+ thread_id=run["thread_id"],
203
+ stream_mode=await sub,
204
+ cancel_on_disconnect=on_disconnect == "cancel",
201
205
  )
202
206
  ) as stream:
203
207
  async for mode, chunk, _ in stream:
@@ -248,6 +252,7 @@ async def wait_run(request: ApiRequest):
248
252
  async def wait_run_stateless(request: ApiRequest):
249
253
  """Create a stateless run, wait for the output."""
250
254
  payload = await request.json(RunCreateStateless)
255
+ on_disconnect = payload.get("on_disconnect", "continue")
251
256
  run_id = uuid6()
252
257
  sub = asyncio.create_task(Runs.Stream.subscribe(run_id))
253
258
 
@@ -277,6 +282,7 @@ async def wait_run_stateless(request: ApiRequest):
277
282
  thread_id=run["thread_id"],
278
283
  stream_mode=await sub,
279
284
  ignore_404=True,
285
+ cancel_on_disconnect=on_disconnect == "cancel",
280
286
  )
281
287
  ) as stream:
282
288
  async for mode, chunk, _ in stream:
langgraph_api/worker.py CHANGED
@@ -307,23 +307,9 @@ async def worker(
307
307
  conn, run["thread_id"], run_id, status, checkpoint, exception
308
308
  )
309
309
 
310
- # delete or set status of thread
311
- if not isinstance(exception, ALL_RETRIABLE_EXCEPTIONS):
312
- if temporary:
313
- await Threads.delete(conn, run["thread_id"])
314
- else:
315
- try:
316
- await Threads.set_status(
317
- conn, run["thread_id"], checkpoint, exception
318
- )
319
- except HTTPException as e:
320
- if e.status_code == 404:
321
- await logger.ainfo(
322
- "Ignoring set_status error for missing thread",
323
- exc=str(e),
324
- )
325
- else:
326
- raise
310
+ # delete thread if it's temporary and we don't want to retry
311
+ if temporary and not isinstance(exception, ALL_RETRIABLE_EXCEPTIONS):
312
+ await Threads.delete(conn, run["thread_id"])
327
313
 
328
314
  if isinstance(exception, ALL_RETRIABLE_EXCEPTIONS):
329
315
  await logger.awarning("RETRYING", exc_info=exception)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: langgraph-api
3
- Version: 0.2.83
3
+ Version: 0.2.85
4
4
  Author-email: Nuno Campos <nuno@langchain.dev>, Will Fu-Hinthorn <will@langchain.dev>
5
5
  License: Elastic-2.0
6
6
  License-File: LICENSE
@@ -1,4 +1,4 @@
1
- langgraph_api/__init__.py,sha256=pjPizgc1F0inosPx3drrKz6OVCqyJA5RpGxHjw1BzHI,23
1
+ langgraph_api/__init__.py,sha256=wU64I3Xh8GFqegDoLD5yhSQwid8d-OGebpjwuhZIE7I,23
2
2
  langgraph_api/asgi_transport.py,sha256=eqifhHxNnxvI7jJqrY1_8RjL4Fp9NdN4prEub2FWBt8,5091
3
3
  langgraph_api/asyncio.py,sha256=qrYEqPRrqtGq7E7KjcMC-ALyN79HkRnmp9rM2TAw9L8,9404
4
4
  langgraph_api/cli.py,sha256=-R0fvxg4KNxTkSe7xvDZruF24UMhStJYjpAYlUx3PBk,16018
@@ -25,13 +25,13 @@ langgraph_api/thread_ttl.py,sha256=-Ox8NFHqUH3wGNdEKMIfAXUubY5WGifIgCaJ7npqLgw,1
25
25
  langgraph_api/utils.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
26
26
  langgraph_api/validation.py,sha256=zMuKmwUEBjBgFMwAaeLZmatwGVijKv2sOYtYg7gfRtc,4950
27
27
  langgraph_api/webhook.py,sha256=VCJp4dI5E1oSJ15XP34cnPiOi8Ya8Q1BnBwVGadOpLI,1636
28
- langgraph_api/worker.py,sha256=fL0pNEW9FaldEREq_4L-ivkxTr2R_rEpmVMi-zRx__U,14226
28
+ langgraph_api/worker.py,sha256=HHgdwq79gBLFLiIwaFap_TmBigIu3Tfno_SwsjdyjGU,13675
29
29
  langgraph_api/api/__init__.py,sha256=WHy6oNLWtH1K7AxmmsU9RD-Vm6WP-Ov16xS8Ey9YCmQ,6090
30
30
  langgraph_api/api/assistants.py,sha256=w7nXjEknDVHSuP228S8ZLh4bG0nRGnSwVP9pECQOK90,16247
31
31
  langgraph_api/api/mcp.py,sha256=RvRYgANqRzNQzSmgjNkq4RlKTtoEJYil04ot9lsmEtE,14352
32
- langgraph_api/api/meta.py,sha256=LnDyfO-YJx8WbFS7VR6LCeB8zL5vxH6vFHd87aqHnjk,4106
32
+ langgraph_api/api/meta.py,sha256=fmc7btbtl5KVlU_vQ3Bj4J861IjlqmjBKNtnxSV-S-Q,4198
33
33
  langgraph_api/api/openapi.py,sha256=KToI2glOEsvrhDpwdScdBnL9xoLOqkTxx5zKq2pMuKQ,11957
34
- langgraph_api/api/runs.py,sha256=1rNUbFleakTYAqG20cGtpWyY2TS5EoVgT4Pxe1AQ68E,19692
34
+ langgraph_api/api/runs.py,sha256=66x7Nywqr1OoMHHlG03OGuLlrbKYbfvLJepYLg6oXeE,19975
35
35
  langgraph_api/api/store.py,sha256=TSeMiuMfrifmEnEbL0aObC2DPeseLlmZvAMaMzPgG3Y,5535
36
36
  langgraph_api/api/threads.py,sha256=ogMKmEoiycuaV3fa5kpupDohJ7fwUOfVczt6-WSK4FE,9322
37
37
  langgraph_api/api/ui.py,sha256=2nlipYV2nUGR4T9pceaAbgN1lS3-T2zPBh7Nv3j9eZQ,2479
@@ -90,8 +90,8 @@ langgraph_runtime/store.py,sha256=7mowndlsIroGHv3NpTSOZDJR0lCuaYMBoTnTrewjslw,11
90
90
  LICENSE,sha256=ZPwVR73Biwm3sK6vR54djCrhaRiM4cAD2zvOQZV8Xis,3859
91
91
  logging.json,sha256=3RNjSADZmDq38eHePMm1CbP6qZ71AmpBtLwCmKU9Zgo,379
92
92
  openapi.json,sha256=p5tn_cNRiFA0HN3L6JfC9Nm16Hgv-BxvAQcJymKhVWI,143296
93
- langgraph_api-0.2.83.dist-info/METADATA,sha256=KgKghdie5R6f4M5GUiDpMumPq7bShgf7TmuSpRRZzps,3891
94
- langgraph_api-0.2.83.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
95
- langgraph_api-0.2.83.dist-info/entry_points.txt,sha256=hGedv8n7cgi41PypMfinwS_HfCwA7xJIfS0jAp8htV8,78
96
- langgraph_api-0.2.83.dist-info/licenses/LICENSE,sha256=ZPwVR73Biwm3sK6vR54djCrhaRiM4cAD2zvOQZV8Xis,3859
97
- langgraph_api-0.2.83.dist-info/RECORD,,
93
+ langgraph_api-0.2.85.dist-info/METADATA,sha256=AGw_kM4W7fuNQeG5Kyca-hL-N6xl_QhxPgaHrezkXkE,3891
94
+ langgraph_api-0.2.85.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
95
+ langgraph_api-0.2.85.dist-info/entry_points.txt,sha256=hGedv8n7cgi41PypMfinwS_HfCwA7xJIfS0jAp8htV8,78
96
+ langgraph_api-0.2.85.dist-info/licenses/LICENSE,sha256=ZPwVR73Biwm3sK6vR54djCrhaRiM4cAD2zvOQZV8Xis,3859
97
+ langgraph_api-0.2.85.dist-info/RECORD,,