langgraph-api 0.0.13__py3-none-any.whl → 0.0.15__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/queue.py CHANGED
@@ -2,7 +2,7 @@ import asyncio
2
2
  from contextlib import AsyncExitStack
3
3
  from datetime import UTC, datetime
4
4
  from random import random
5
- from typing import cast
5
+ from typing import TypedDict, cast
6
6
 
7
7
  import structlog
8
8
  from langgraph.pregel.debug import CheckpointPayload, TaskResultPayload
@@ -13,7 +13,7 @@ from langgraph_api.errors import (
13
13
  UserRollback,
14
14
  )
15
15
  from langgraph_api.http import get_http_client
16
- from langgraph_api.js.remote import RemoteException
16
+ from langgraph_api.js.errors import RemoteException
17
17
  from langgraph_api.metadata import incr_runs
18
18
  from langgraph_api.schema import Run
19
19
  from langgraph_api.stream import (
@@ -28,6 +28,7 @@ from langgraph_storage.retry import RETRIABLE_EXCEPTIONS
28
28
  logger = structlog.stdlib.get_logger(__name__)
29
29
 
30
30
  WORKERS: set[asyncio.Task] = set()
31
+ WEBHOOKS: set[asyncio.Task] = set()
31
32
  MAX_RETRY_ATTEMPTS = 3
32
33
  SHUTDOWN_GRACE_PERIOD_SECS = 5
33
34
 
@@ -45,10 +46,46 @@ async def queue(concurrency: int, timeout: float):
45
46
  WORKERS.remove(task)
46
47
  semaphore.release()
47
48
  try:
48
- if exc := task.exception():
49
+ result: WorkerResult | None = task.result()
50
+ exc = task.exception()
51
+ if exc:
49
52
  logger.exception("Background worker failed", exc_info=exc)
53
+ if result and result["webhook"]:
54
+ checkpoint = result["checkpoint"]
55
+ payload = {
56
+ **result["run"],
57
+ "status": result["status"],
58
+ "run_started_at": result["run_started_at"],
59
+ "run_ended_at": result["run_ended_at"],
60
+ "webhook_sent_at": datetime.now(UTC).isoformat(),
61
+ "values": checkpoint["values"] if checkpoint else None,
62
+ }
63
+ if exception := result["exception"]:
64
+ payload["error"] = str(exception)
65
+
66
+ async def _call_webhook() -> None:
67
+ try:
68
+ await get_http_client().post(
69
+ result["webhook"], json=payload, total_timeout=20
70
+ )
71
+ except Exception as exc:
72
+ logger.exception(
73
+ f"Background worker failed to call webhook {result['webhook']}",
74
+ exc_info=exc,
75
+ webhook=result["webhook"],
76
+ )
77
+
78
+ hook_task = asyncio.create_task(
79
+ _call_webhook(),
80
+ name=f"webhook-{result['run']['run_id']}",
81
+ )
82
+ WEBHOOKS.add(hook_task)
83
+ hook_task.add_done_callback(WEBHOOKS.remove)
84
+
50
85
  except asyncio.CancelledError:
51
86
  pass
87
+ except Exception as exc:
88
+ logger.exception("Background worker cleanup failed", exc_info=exc)
52
89
 
53
90
  await logger.ainfo(f"Starting {concurrency} background workers")
54
91
  try:
@@ -73,9 +110,10 @@ async def queue(concurrency: int, timeout: float):
73
110
  stats = await Runs.stats(conn)
74
111
  await logger.ainfo("Queue stats", **stats)
75
112
  if tup := await exit.enter_async_context(Runs.next(conn)):
113
+ run_, attempt_ = tup
76
114
  task = asyncio.create_task(
77
- worker(timeout, exit, conn, *tup),
78
- name=f"run-{tup[0]['run_id']}-attempt-{tup[1]}",
115
+ worker(timeout, exit, conn, run_, attempt_),
116
+ name=f"run-{run_['run_id']}-attempt-{attempt_}",
79
117
  )
80
118
  task.add_done_callback(cleanup)
81
119
  WORKERS.add(task)
@@ -93,28 +131,42 @@ async def queue(concurrency: int, timeout: float):
93
131
  logger.info("Shutting down background workers")
94
132
  for task in WORKERS:
95
133
  task.cancel()
134
+ for task in WEBHOOKS:
135
+ task.cancel()
96
136
  await asyncio.wait_for(
97
- asyncio.gather(*WORKERS, return_exceptions=True), SHUTDOWN_GRACE_PERIOD_SECS
137
+ asyncio.gather(*WORKERS, *WEBHOOKS, return_exceptions=True),
138
+ SHUTDOWN_GRACE_PERIOD_SECS,
98
139
  )
99
140
 
100
141
 
142
+ class WorkerResult(TypedDict):
143
+ checkpoint: CheckpointPayload | None
144
+ status: str | None
145
+ exception: Exception | None
146
+ run: Run
147
+ webhook: str | None
148
+ run_started_at: str
149
+ run_ended_at: str | None
150
+
151
+
101
152
  async def worker(
102
153
  timeout: float,
103
154
  exit: AsyncExitStack,
104
155
  conn: AsyncConnectionProto,
105
156
  run: Run,
106
157
  attempt: int,
107
- ):
158
+ ) -> WorkerResult:
108
159
  run_id = run["run_id"]
109
160
  if attempt == 1:
110
161
  incr_runs()
162
+ checkpoint: CheckpointPayload | None = None
163
+ exception: Exception | None = None
164
+ status: str | None = None
165
+ webhook = run["kwargs"].pop("webhook", None)
166
+ run_started_at = datetime.now(UTC)
167
+ run_ended_at: str | None = None
111
168
  async with Runs.enter(run_id) as done, exit:
112
169
  temporary = run["kwargs"].get("temporary", False)
113
- webhook = run["kwargs"].pop("webhook", None)
114
- checkpoint: CheckpointPayload | None = None
115
- exception: Exception | None = None
116
- status: str | None = None
117
- run_started_at = datetime.now(UTC)
118
170
  run_created_at = run["created_at"].isoformat()
119
171
  await logger.ainfo(
120
172
  "Starting background run",
@@ -154,13 +206,14 @@ async def worker(
154
206
  on_task_result=on_task_result,
155
207
  )
156
208
  await asyncio.wait_for(consume(stream, run_id), timeout)
209
+ run_ended_at = datetime.now(UTC).isoformat()
157
210
  await logger.ainfo(
158
211
  "Background run succeeded",
159
212
  run_id=str(run_id),
160
213
  run_attempt=attempt,
161
214
  run_created_at=run_created_at,
162
215
  run_started_at=run_started_at.isoformat(),
163
- run_ended_at=datetime.now().isoformat(),
216
+ run_ended_at=run_ended_at,
164
217
  run_exec_ms=ms(datetime.now(UTC), run_started_at),
165
218
  )
166
219
  status = "success"
@@ -168,45 +221,49 @@ async def worker(
168
221
  except TimeoutError as e:
169
222
  exception = e
170
223
  status = "timeout"
224
+ run_ended_at = datetime.now(UTC).isoformat()
171
225
  await logger.awarning(
172
226
  "Background run timed out",
173
227
  run_id=str(run_id),
174
228
  run_attempt=attempt,
175
229
  run_created_at=run_created_at,
176
230
  run_started_at=run_started_at.isoformat(),
177
- run_ended_at=datetime.now().isoformat(),
231
+ run_ended_at=run_ended_at,
178
232
  run_exec_ms=ms(datetime.now(UTC), run_started_at),
179
233
  )
180
234
  await Runs.set_status(conn, run_id, "timeout")
181
235
  except UserRollback as e:
182
236
  exception = e
183
237
  status = "rollback"
238
+ run_ended_at = datetime.now(UTC).isoformat()
184
239
  await logger.ainfo(
185
240
  "Background run rolled back",
186
241
  run_id=str(run_id),
187
242
  run_attempt=attempt,
188
243
  run_created_at=run_created_at,
189
244
  run_started_at=run_started_at.isoformat(),
190
- run_ended_at=datetime.now().isoformat(),
245
+ run_ended_at=run_ended_at,
191
246
  run_exec_ms=ms(datetime.now(UTC), run_started_at),
192
247
  )
193
248
  await Runs.delete(conn, run_id, thread_id=run["thread_id"])
194
249
  except UserInterrupt as e:
195
250
  exception = e
196
251
  status = "interrupted"
252
+ run_ended_at = datetime.now(UTC).isoformat()
197
253
  await logger.ainfo(
198
254
  "Background run interrupted",
199
255
  run_id=str(run_id),
200
256
  run_attempt=attempt,
201
257
  run_created_at=run_created_at,
202
258
  run_started_at=run_started_at.isoformat(),
203
- run_ended_at=datetime.now().isoformat(),
259
+ run_ended_at=run_ended_at,
204
260
  run_exec_ms=ms(datetime.now(UTC), run_started_at),
205
261
  )
206
262
  await Runs.set_status(conn, run_id, "interrupted")
207
263
  except RETRIABLE_EXCEPTIONS as e:
208
264
  exception = e
209
265
  status = "retry"
266
+ run_ended_at = datetime.now(UTC).isoformat()
210
267
  await logger.awarning(
211
268
  "Background run failed, will retry",
212
269
  exc_info=True,
@@ -214,7 +271,7 @@ async def worker(
214
271
  run_attempt=attempt,
215
272
  run_created_at=run_created_at,
216
273
  run_started_at=run_started_at.isoformat(),
217
- run_ended_at=datetime.now().isoformat(),
274
+ run_ended_at=run_ended_at,
218
275
  run_exec_ms=ms(datetime.now(UTC), run_started_at),
219
276
  )
220
277
  raise
@@ -223,6 +280,7 @@ async def worker(
223
280
  except Exception as exc:
224
281
  exception = exc
225
282
  status = "error"
283
+ run_ended_at = datetime.now(UTC).isoformat()
226
284
  await logger.aexception(
227
285
  "Background run failed",
228
286
  exc_info=not isinstance(exc, RemoteException),
@@ -230,7 +288,7 @@ async def worker(
230
288
  run_attempt=attempt,
231
289
  run_created_at=run_created_at,
232
290
  run_started_at=run_started_at.isoformat(),
233
- run_ended_at=datetime.now().isoformat(),
291
+ run_ended_at=run_ended_at,
234
292
  run_exec_ms=ms(datetime.now(UTC), run_started_at),
235
293
  )
236
294
  await Runs.set_status(conn, run_id, "error")
@@ -239,15 +297,15 @@ async def worker(
239
297
  await Threads.delete(conn, run["thread_id"])
240
298
  else:
241
299
  await Threads.set_status(conn, run["thread_id"], checkpoint, exception)
242
- if webhook:
243
- # TODO add error, values to webhook payload
244
- # TODO add retries for webhook calls
245
- try:
246
- await get_http_client().post(
247
- webhook, json={**run, "status": status}, total_timeout=5
248
- )
249
- except Exception as e:
250
- logger.warning("Failed to send webhook", exc_info=e)
251
300
  # Note we don't handle asyncio.CancelledError here, as we want to
252
301
  # let it bubble up and rollback db transaction, thus marking the run
253
302
  # as available to be picked up by another worker
303
+ return {
304
+ "checkpoint": checkpoint,
305
+ "status": status,
306
+ "run_started_at": run_started_at.isoformat(),
307
+ "run_ended_at": run_ended_at,
308
+ "run": run,
309
+ "exception": exception,
310
+ "webhook": webhook,
311
+ }
langgraph_api/stream.py CHANGED
@@ -25,7 +25,7 @@ from pydantic.v1 import ValidationError as ValidationErrorLegacy
25
25
 
26
26
  from langgraph_api.asyncio import ValueEvent, wait_if_not_done
27
27
  from langgraph_api.graph import get_graph
28
- from langgraph_api.js.remote import RemotePregel
28
+ from langgraph_api.js.base import BaseRemotePregel
29
29
  from langgraph_api.metadata import HOST, PLAN, incr_nodes
30
30
  from langgraph_api.schema import Run, RunCommand, StreamMode
31
31
  from langgraph_api.serde import json_dumpb
@@ -133,7 +133,7 @@ async def astream_state(
133
133
  config["metadata"]["langgraph_plan"] = PLAN
134
134
  config["metadata"]["langgraph_host"] = HOST
135
135
  # attach node counter
136
- if not isinstance(graph, RemotePregel):
136
+ if not isinstance(graph, BaseRemotePregel):
137
137
  config["configurable"]["__pregel_node_finished"] = incr_nodes
138
138
  # TODO add node tracking for JS graphs
139
139
  # attach run_id to config
@@ -142,7 +142,7 @@ async def astream_state(
142
142
  # set up state
143
143
  checkpoint: CheckpointPayload | None = None
144
144
  messages: dict[str, BaseMessageChunk] = {}
145
- use_astream_events = "events" in stream_mode or isinstance(graph, RemotePregel)
145
+ use_astream_events = "events" in stream_mode or isinstance(graph, BaseRemotePregel)
146
146
  # yield metadata chunk
147
147
  yield "metadata", {"run_id": run_id, "attempt": attempt}
148
148
  # stream run
@@ -166,7 +166,7 @@ async def astream_state(
166
166
  break
167
167
  if event.get("tags") and "langsmith:hidden" in event["tags"]:
168
168
  continue
169
- if "messages" in stream_mode and isinstance(graph, RemotePregel):
169
+ if "messages" in stream_mode and isinstance(graph, BaseRemotePregel):
170
170
  if event["event"] == "on_custom_event" and event["name"] in (
171
171
  "messages/complete",
172
172
  "messages/partial",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: langgraph-api
3
- Version: 0.0.13
3
+ Version: 0.0.15
4
4
  Summary:
5
5
  License: Elastic-2.0
6
6
  Author: Nuno Campos
@@ -20,7 +20,7 @@ Requires-Dist: langgraph-sdk (>=0.1.48,<0.2.0)
20
20
  Requires-Dist: langsmith (>=0.1.63,<0.3.0)
21
21
  Requires-Dist: orjson (>=3.10.1)
22
22
  Requires-Dist: pyjwt (>=2.9.0,<3.0.0)
23
- Requires-Dist: sse-starlette (>=2.1.0,<3.0.0)
23
+ Requires-Dist: sse-starlette (>=2.1.0,<2.2.0)
24
24
  Requires-Dist: starlette (>=0.38.6)
25
25
  Requires-Dist: structlog (>=24.4.0,<25.0.0)
26
26
  Requires-Dist: tenacity (>=8.3.0,<9.0.0)
@@ -1,7 +1,7 @@
1
1
  LICENSE,sha256=ZPwVR73Biwm3sK6vR54djCrhaRiM4cAD2zvOQZV8Xis,3859
2
2
  langgraph_api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
- langgraph_api/api/__init__.py,sha256=tlMXuqnyJt99aSlUXwR-dS3w5X6sDDczJu4hbm2LP30,2057
4
- langgraph_api/api/assistants.py,sha256=Cxryr4K4qFeRoT0gQTu-gld_jSPzMDRZRHoazlSBZVo,11585
3
+ langgraph_api/api/__init__.py,sha256=zAdS_0jgjmCJK6E0VwEuNcNRkaknMXfQ2C_OES5tEI4,2066
4
+ langgraph_api/api/assistants.py,sha256=nn-0Q5FTaEbdPq-oesrpVzqu223PDSzeejFy9fd5Xjw,11599
5
5
  langgraph_api/api/meta.py,sha256=hueasWpTDQ6xYLo9Bzt2jhNH8XQRzreH8FTeFfnRoxQ,2700
6
6
  langgraph_api/api/openapi.py,sha256=AUxfnD5hlRp7s-0g2hBC5dNSNk3HTwOLeJiF489DT44,2762
7
7
  langgraph_api/api/runs.py,sha256=wAzPXi_kcYB9BcLBL4FXgkBohWwCPIpe4XERnsnWnsA,16042
@@ -17,18 +17,24 @@ langgraph_api/auth/middleware.py,sha256=qc7SbaFoeWaqxS1wbjZ2PPQ4iI2p9T0shWL7c6g0
17
17
  langgraph_api/auth/noop.py,sha256=vDJmzG2vArJxVzdHePvrJWahEa0dvGnhc2LEMMeiFz0,391
18
18
  langgraph_api/auth/studio_user.py,sha256=FzFQRROKDlA9JjtBuwyZvk6Mbwno5M9RVYjDO6FU3F8,186
19
19
  langgraph_api/cli.py,sha256=7vQQiD3F50r-8KkbuFjwIz8LLbdKUTd4xZGUJPiO3yQ,11688
20
- langgraph_api/config.py,sha256=JueNW95UDn7uId3atctyC9BPZTzmUqwF2Gtr2i-MZ-g,2739
20
+ langgraph_api/config.py,sha256=HPNSCb-owhu_sU8KBLbTbKLdGIPGVLcSgdvKFKXg7uE,2816
21
21
  langgraph_api/cron_scheduler.py,sha256=CybK-9Jwopi_scObTHRyB7gyb0KjC4gqaT2GLe-WOFg,2587
22
22
  langgraph_api/errors.py,sha256=Bu_i5drgNTyJcLiyrwVE_6-XrSU50BHf9TDpttki9wQ,1690
23
- langgraph_api/graph.py,sha256=zjcjgtlvfPIEJws8RksC6wKvt3g-8IGaJj79ScSs6GE,16561
23
+ langgraph_api/graph.py,sha256=FombjYQkqj8jrXJFEVkl3m2UyFcq5nSVNswR2HoRsQY,16385
24
24
  langgraph_api/http.py,sha256=XrbyxpjtfSvnaWWh5ZLGpgZmY83WoDCrP_1GPguNiXI,4712
25
25
  langgraph_api/http_logger.py,sha256=Sxo_q-65tElauRvkzVLt9lJojgNdgtcHGBYD0IRyX7M,3146
26
26
  langgraph_api/js/.gitignore,sha256=qAah3Fq0HWAlfRj5ktZyC6QRQIsAolGLRGcRukA1XJI,33
27
- langgraph_api/js/build.mts,sha256=v4ZJFnfBJBuLn8g0q-Uab9sgNtcssXcFEI-CmMoiOBc,1301
28
- langgraph_api/js/client.mts,sha256=GF34EYtjIKvl9u44PeWhWD_QCbTbrxFQ-BL-7v6P23c,24434
27
+ langgraph_api/js/base.py,sha256=BpE8-xkUp8HFPRjSKx1tfUQubvoV4jYl6OwZdre3veI,209
28
+ langgraph_api/js/build.mts,sha256=sAZXB3xVSoG8exJ1ZEytFyikRmEsXJ_0OlLjDDgD79o,1342
29
+ langgraph_api/js/client.mts,sha256=ksiytm222KTUWj92ZnajqFku_y2AkRmfENmKie5LSPw,22519
30
+ langgraph_api/js/client.new.mts,sha256=9FrArkM20IeD176Q7u5lJNruaQXqAfAdDcqJkF0TPPA,23493
31
+ langgraph_api/js/errors.py,sha256=Cm1TKWlUCwZReDC5AQ6SgNIVGD27Qov2xcgHyf8-GXo,361
29
32
  langgraph_api/js/global.d.ts,sha256=zR_zLYfpzyPfxpEFth5RgZoyfGulIXyZYPRf7cU0K0Y,106
30
- langgraph_api/js/package.json,sha256=nxZ3fmuO4ZiKli087PxrK8p95ZrQKaubQa2wDKRnwsk,791
31
- langgraph_api/js/remote.py,sha256=rudGN-8kHVuEbnGeDMEZbn__edtqkjxXlrxIuO1xOo0,23323
33
+ langgraph_api/js/package.json,sha256=QvZQVTWP0uYnPD_o7ETIuv9Hczn98bWfMEwTgjbBYCs,840
34
+ langgraph_api/js/remote.py,sha256=D9cqcEgXau-fm_trpNwCHMra5BXntgUa469lgs_a9JQ,622
35
+ langgraph_api/js/remote_new.py,sha256=LfCY7DIsJ6DulepYIPmvjIKb3kyDUD9lYrpekXhTF-E,22277
36
+ langgraph_api/js/remote_old.py,sha256=mzM-AwYSRZQQTZvbmd680RIIVlSrO9amMtOHq3DQRcI,22088
37
+ langgraph_api/js/schema.py,sha256=7idnv7URlYUdSNMBXQcw7E4SxaPxCq_Oxwnlml8q5ik,408
32
38
  langgraph_api/js/server_sent_events.py,sha256=DLgXOHauemt7706vnfDUCG1GI3TidKycSizccdz9KgA,3702
33
39
  langgraph_api/js/src/graph.mts,sha256=EO1ITYoKiUykzO_8V8mnQb6NYybooR1VXIovThZzywc,2998
34
40
  langgraph_api/js/src/hooks.mjs,sha256=XtktgmIHlls_DsknAuwib-z7TqCm0haRoTXvnkgzMuo,601
@@ -38,34 +44,35 @@ langgraph_api/js/src/schema/types.mts,sha256=SUj0vpvWVbID1mnGr2SUtumDBQkJ9zjfvJd
38
44
  langgraph_api/js/src/schema/types.template.mts,sha256=c-FA0Ykzp4KvPyYA6a-hDf60KdQRMyFEjmGVJyD2OPM,2011
39
45
  langgraph_api/js/src/utils/importMap.mts,sha256=pX4TGOyUpuuWF82kXcxcv3-8mgusRezOGe6Uklm2O5A,1644
40
46
  langgraph_api/js/src/utils/pythonSchemas.mts,sha256=98IW7Z_VP7L_CHNRMb3_MsiV3BgLE2JsWQY_PQcRR3o,685
41
- langgraph_api/js/src/utils/serde.mts,sha256=5SO-wYPnPa8f-D6HQX5Oy3NX3nuziZM8vQMqc2tuxbk,531
42
- langgraph_api/js/tests/api.test.mts,sha256=ZfwWmu6RgxMBELwR5PUpGOdVFkeDWlONPx-f_huSRok,52248
43
- langgraph_api/js/tests/compose-postgres.yml,sha256=7VCpWUgPjCzybf6Gu6pT788sZsxUnTjhbmji6c33cVc,1639
47
+ langgraph_api/js/src/utils/serde.mts,sha256=OuyyO9btvwWd55rU_H4x91dFEJiaPxL-lL9O6Zgo908,742
48
+ langgraph_api/js/tests/api.test.mts,sha256=sFUW1_ffW3IUsQCdU7ToJ67QiTcwiYlxDJuUVbFh4_I,53215
49
+ langgraph_api/js/tests/compose-postgres.yml,sha256=pbNfeqVUqhWILBuUdwAgQOYsVU_fgkCVm0YlTgU8og8,1721
44
50
  langgraph_api/js/tests/graphs/.gitignore,sha256=26J8MarZNXh7snXD5eTpV3CPFTht5Znv8dtHYCLNfkw,12
45
51
  langgraph_api/js/tests/graphs/agent.mts,sha256=i2s0GOnydW88laDGBatYkQnjUe9Q44RNHDhdEGIcT8w,3811
52
+ langgraph_api/js/tests/graphs/delay.mts,sha256=QByzUlICCBhaOBYG1Yi9TSl8Ss6w8sx0lETCCTu0kjY,617
46
53
  langgraph_api/js/tests/graphs/error.mts,sha256=l4tk89449dj1BnEF_0ZcfPt0Ikk1gl8L1RaSnRfr3xo,487
47
- langgraph_api/js/tests/graphs/langgraph.json,sha256=-wSU_9H2fraq7Tijq_dTuK8SBDYLHsnfrYgi2zYUK2o,155
54
+ langgraph_api/js/tests/graphs/langgraph.json,sha256=frxd7ZWILdeMYSZgUBH6UO-IR7I2YJSOfOlx2mnO1sI,189
48
55
  langgraph_api/js/tests/graphs/nested.mts,sha256=4G7jSOSaFVQAza-_ARbK-Iai1biLlF2DIPDZXf7PLIY,1245
49
56
  langgraph_api/js/tests/graphs/package.json,sha256=kG5a7jRCnlSQMV2WXUsXegmp5cCWm9F3AOIBUUqPn8A,118
50
57
  langgraph_api/js/tests/graphs/weather.mts,sha256=A7mLK3xW8h5B-ZyJNAyX2M2fJJwzPJzXs4DYesJwreQ,1655
51
58
  langgraph_api/js/tests/graphs/yarn.lock,sha256=q-1S--E5VWLYtkSv03shqtNzeDDv-N_J-N26FszLsjs,7903
52
59
  langgraph_api/js/tests/parser.test.mts,sha256=3zAbboUNhI-cY3hj4Ssr7J-sQXCBTeeI1ItrkG0Ftuk,26257
53
60
  langgraph_api/js/tests/utils.mts,sha256=2kTybJ3O7Yfe1q3ehDouqV54ibXkNzsPZ_wBZLJvY-4,421
54
- langgraph_api/js/yarn.lock,sha256=roj7_0fuKEyeDgQqHIx6CDLjfX73-OsQz342QQlQo_E,65156
61
+ langgraph_api/js/yarn.lock,sha256=OD3NXIjBlUlbb6t8vFhOKlnQm4CvGWhB9Ns9W5omPlo,103690
55
62
  langgraph_api/lifespan.py,sha256=Uj7NV-NqxxD1fgx_umM9pVqclcy-VlqrIxDljyj2he0,1820
56
63
  langgraph_api/logging.py,sha256=tiDNrEFwqaIdL5ywZv908OXlzzfXsPCws9GXeoFtBV8,3367
57
64
  langgraph_api/metadata.py,sha256=mih2G7ScQxiqyUlbksVXkqR3Oo-pM1b6lXtzOsgR1sw,3044
58
65
  langgraph_api/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
59
66
  langgraph_api/models/run.py,sha256=qGTcgQjnzmXrxer5VPaGHoGwifV1nyE4ZCXtBiZH1bc,9546
60
67
  langgraph_api/patch.py,sha256=94ddcTSZJe22JcpjxiSNjFZdYVnmeoWjk4IX4iBSoyk,1249
61
- langgraph_api/queue.py,sha256=7tsbDgv4GlUYieJsrvIJDMQUEok4Eu-n_PIQ93rwKjk,9810
68
+ langgraph_api/queue.py,sha256=pB2IGzArlmUzKOewJ7ejIOVDPGCYSzG6Mok1gXtsjdA,11955
62
69
  langgraph_api/route.py,sha256=HnAcWeStCrWNe37YUXIqEsjsrCPCIPGijHG7pM9ga28,4251
63
70
  langgraph_api/schema.py,sha256=EiCWRR2GmGrBrOYcuK9SeVQS5b98SdaJlKaqOL7t-WQ,5263
64
71
  langgraph_api/serde.py,sha256=VoJ7Z1IuqrQGXFzEP1qijAITtWCrmjtVqlCRuScjXJI,3533
65
72
  langgraph_api/server.py,sha256=afHDnL6b_fAIu_q4icnK60a74lHTTZOMIe1egdhRXIk,1522
66
73
  langgraph_api/sse.py,sha256=2wNodCOP2eg7a9mpSu0S3FQ0CHk2BBV_vv0UtIgJIcc,4034
67
74
  langgraph_api/state.py,sha256=8jx4IoTCOjTJuwzuXJKKFwo1VseHjNnw_CCq4x1SW14,2284
68
- langgraph_api/stream.py,sha256=uK1MFr3hp08o3yE-W5V36CljaPmo97VfpDtexa5eqOQ,11663
75
+ langgraph_api/stream.py,sha256=fedsd2rJu9sao6ez4P-_n3Z4jsMzQxxqwssoVr-vbLo,11677
69
76
  langgraph_api/utils.py,sha256=o7TFlY25IjujeKdXgtyE2mMLPETIlrbOc3w6giYBq2Y,2509
70
77
  langgraph_api/validation.py,sha256=McizHlz-Ez8Jhdbc79mbPSde7GIuf2Jlbjx2yv_l6dA,4475
71
78
  langgraph_license/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -74,15 +81,15 @@ langgraph_license/validation.py,sha256=Uu_G8UGO_WTlLsBEY0gTVWjRR4czYGfw5YAD3HLZo
74
81
  langgraph_storage/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
75
82
  langgraph_storage/checkpoint.py,sha256=V4t2GwYEJdPCHbhq_4Udhlv0TWKDzlMu_rlNPdTDc50,3589
76
83
  langgraph_storage/database.py,sha256=Nr5zE9Fur3-tESkqe7xNXMf2QlBuw3H0CUie7jVa6Q4,6003
77
- langgraph_storage/ops.py,sha256=vinc095b_eZYSWAfK_trZbmb_IIGcp55lWJEzqRwTPU,67967
84
+ langgraph_storage/ops.py,sha256=l6sL3wq9vp2OJwhRbdNkPozi-bi2ma-yXHBNGRbmQzk,67985
78
85
  langgraph_storage/queue.py,sha256=6cTZ0ubHu3S1T43yxHMVOwsQsDaJupByiU0sTUFFls8,3261
79
86
  langgraph_storage/retry.py,sha256=uvYFuXJ-T6S1QY1ZwkZHyZQbsvS-Ab68LSbzbUUSI2E,696
80
87
  langgraph_storage/store.py,sha256=D-p3cWc_umamkKp-6Cz3cAriSACpvM5nxUIvND6PuxE,2710
81
88
  langgraph_storage/ttl_dict.py,sha256=FlpEY8EANeXWKo_G5nmIotPquABZGyIJyk6HD9u6vqY,1533
82
89
  logging.json,sha256=3RNjSADZmDq38eHePMm1CbP6qZ71AmpBtLwCmKU9Zgo,379
83
90
  openapi.json,sha256=gh6FxpyQqspAuQQH3O22qqGW5owtFj45gyR15QAcS9k,124729
84
- langgraph_api-0.0.13.dist-info/LICENSE,sha256=ZPwVR73Biwm3sK6vR54djCrhaRiM4cAD2zvOQZV8Xis,3859
85
- langgraph_api-0.0.13.dist-info/METADATA,sha256=F_D67LIP0IP8jFVJ5wUwieyIqFuAP_mtrDNe8uZS8Rs,4041
86
- langgraph_api-0.0.13.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
87
- langgraph_api-0.0.13.dist-info/entry_points.txt,sha256=3EYLgj89DfzqJHHYGxPH4A_fEtClvlRbWRUHaXO7hj4,77
88
- langgraph_api-0.0.13.dist-info/RECORD,,
91
+ langgraph_api-0.0.15.dist-info/LICENSE,sha256=ZPwVR73Biwm3sK6vR54djCrhaRiM4cAD2zvOQZV8Xis,3859
92
+ langgraph_api-0.0.15.dist-info/METADATA,sha256=Z_TZtWNrQ6jCCYhOHrV3zxhk4Dghxj-YZkyjKu_rqyQ,4041
93
+ langgraph_api-0.0.15.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
94
+ langgraph_api-0.0.15.dist-info/entry_points.txt,sha256=3EYLgj89DfzqJHHYGxPH4A_fEtClvlRbWRUHaXO7hj4,77
95
+ langgraph_api-0.0.15.dist-info/RECORD,,
langgraph_storage/ops.py CHANGED
@@ -92,7 +92,7 @@ class Authenticated:
92
92
  async def handle_event(
93
93
  cls,
94
94
  ctx: Auth.types.BaseAuthContext | None,
95
- action: Literal["create", "read", "update", "delete", "search"],
95
+ action: Literal["create", "read", "update", "delete", "search", "create_run"],
96
96
  value: Any,
97
97
  ) -> Auth.types.FilterType | None:
98
98
  ctx = ctx or get_auth_ctx()
@@ -1299,7 +1299,7 @@ class Runs(Authenticated):
1299
1299
  )
1300
1300
  filters = await Runs.handle_event(
1301
1301
  ctx,
1302
- "create",
1302
+ "create_run",
1303
1303
  Auth.types.RunsCreate(
1304
1304
  thread_id=thread_id,
1305
1305
  assistant_id=assistant_id,