langgraph-api 0.2.92__py3-none-any.whl → 0.2.95__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.92"
1
+ __version__ = "0.2.95"
langgraph_api/api/runs.py CHANGED
@@ -344,7 +344,6 @@ async def list_runs(
344
344
  limit=limit,
345
345
  offset=offset,
346
346
  status=status,
347
- metadata=None,
348
347
  ),
349
348
  )
350
349
  await fetchone(thread)
langgraph_api/api/ui.py CHANGED
@@ -1,12 +1,12 @@
1
1
  import json
2
2
  import os
3
- from typing import TypedDict
4
3
 
5
4
  from anyio import open_file
6
5
  from orjson import loads
7
6
  from starlette.responses import Response
8
7
  from starlette.routing import BaseRoute, Mount
9
8
  from starlette.staticfiles import StaticFiles
9
+ from typing_extensions import TypedDict
10
10
 
11
11
  from langgraph_api.js.ui import UI_PUBLIC_DIR, UI_SCHEMAS_FILE
12
12
  from langgraph_api.route import ApiRequest, ApiRoute
@@ -1,4 +1,4 @@
1
- from typing import NotRequired, TypedDict
1
+ from typing import NotRequired
2
2
 
3
3
  from starlette.authentication import (
4
4
  AuthCredentials,
@@ -7,6 +7,7 @@ from starlette.authentication import (
7
7
  BaseUser,
8
8
  )
9
9
  from starlette.requests import HTTPConnection
10
+ from typing_extensions import TypedDict
10
11
 
11
12
  from langgraph_api.auth.langsmith.client import auth_client
12
13
  from langgraph_api.auth.studio_user import StudioUser
langgraph_api/config.py CHANGED
@@ -1,10 +1,11 @@
1
1
  import os
2
2
  from os import environ, getenv
3
- from typing import Literal, TypedDict
3
+ from typing import Literal
4
4
 
5
5
  import orjson
6
6
  from starlette.config import Config, undefined
7
7
  from starlette.datastructures import CommaSeparatedStrings
8
+ from typing_extensions import TypedDict
8
9
 
9
10
  from langgraph_api import traceblock
10
11
 
@@ -0,0 +1,7 @@
1
+ from langgraph.version import __version__
2
+
3
+ # Only gate features on the major.minor version; Lets you ignore the rc/alpha/etc. releases anyway
4
+ LANGGRAPH_PY_MINOR = tuple(map(int, __version__.split(".")[:2]))
5
+
6
+ OMIT_PENDING_SENDS = LANGGRAPH_PY_MINOR >= (0, 5)
7
+ USE_RUNTIME_API = LANGGRAPH_PY_MINOR >= (0, 6)
langgraph_api/graph.py CHANGED
@@ -9,13 +9,13 @@ import warnings
9
9
  from collections.abc import AsyncIterator, Callable
10
10
  from contextlib import asynccontextmanager
11
11
  from itertools import filterfalse
12
- from typing import TYPE_CHECKING, Any, NamedTuple
12
+ from typing import TYPE_CHECKING, Any, NamedTuple, cast
13
13
  from uuid import UUID, uuid5
14
14
 
15
15
  import orjson
16
16
  import structlog
17
17
  from langgraph.checkpoint.base import BaseCheckpointSaver
18
- from langgraph.constants import CONFIG_KEY_CHECKPOINTER, CONFIG_KEY_STORE
18
+ from langgraph.constants import CONFIG_KEY_CHECKPOINTER
19
19
  from langgraph.graph import StateGraph
20
20
  from langgraph.pregel import Pregel
21
21
  from langgraph.store.base import BaseStore
@@ -23,6 +23,7 @@ from starlette.exceptions import HTTPException
23
23
 
24
24
  from langgraph_api import asyncio as lg_asyncio
25
25
  from langgraph_api import config
26
+ from langgraph_api.feature_flags import USE_RUNTIME_API
26
27
  from langgraph_api.js.base import BaseRemotePregel, is_js_path
27
28
  from langgraph_api.schema import Config
28
29
  from langgraph_api.utils.config import run_in_executor, var_child_runnable_config
@@ -128,8 +129,24 @@ async def get_graph(
128
129
  value = GRAPHS[graph_id]
129
130
  if graph_id in FACTORY_ACCEPTS_CONFIG:
130
131
  config = lg_config.ensure_config(config)
131
- if store is not None and not config["configurable"].get(CONFIG_KEY_STORE):
132
- config["configurable"][CONFIG_KEY_STORE] = store
132
+
133
+ if store is not None:
134
+ if USE_RUNTIME_API:
135
+ from langgraph._internal._constants import CONFIG_KEY_RUNTIME
136
+ from langgraph.runtime import Runtime
137
+
138
+ if (
139
+ (runtime := config["configurable"].get(CONFIG_KEY_RUNTIME))
140
+ is not None
141
+ ) and runtime.store is None:
142
+ patched_runtime = cast(Runtime, runtime).override(store=store)
143
+ config["configurable"][CONFIG_KEY_RUNTIME] = patched_runtime
144
+ else:
145
+ from langgraph.constants import CONFIG_KEY_STORE
146
+
147
+ if not config["configurable"].get(CONFIG_KEY_STORE):
148
+ config["configurable"][CONFIG_KEY_STORE] = store
149
+
133
150
  if checkpointer is not None and not config["configurable"].get(
134
151
  CONFIG_KEY_CHECKPOINTER
135
152
  ):
@@ -414,14 +414,8 @@ class RemoteCheckpointer extends BaseCheckpointSaver<number | string> {
414
414
  }
415
415
 
416
416
  const nextVersion = String(currentVersion + 1).padStart(32, "0");
417
- try {
418
- const hash = createHash("md5")
419
- .update(serialiseAsDict(_channel.checkpoint()))
420
- .digest("hex");
421
- return `${nextVersion}.${hash}`;
422
- } catch {}
423
-
424
- return nextVersion;
417
+ const nextHash = Math.random().toFixed(16).substring(2).padEnd(16, "0");
418
+ return `${nextVersion}.${nextHash}`;
425
419
  }
426
420
  }
427
421
 
@@ -1,4 +1,6 @@
1
- from typing import Any, TypedDict
1
+ from typing import Any
2
+
3
+ from typing_extensions import TypedDict
2
4
 
3
5
 
4
6
  class RequestPayload(TypedDict):
@@ -5,13 +5,14 @@ import time
5
5
  import urllib.parse
6
6
  import uuid
7
7
  from collections.abc import Mapping, Sequence
8
- from typing import Any, NamedTuple, TypedDict
8
+ from typing import Any, NamedTuple
9
9
  from uuid import UUID
10
10
 
11
11
  import orjson
12
12
  from langgraph.checkpoint.base.id import uuid6
13
13
  from starlette.authentication import BaseUser
14
14
  from starlette.exceptions import HTTPException
15
+ from typing_extensions import TypedDict
15
16
 
16
17
  from langgraph_api.graph import GRAPHS, get_assistant_id
17
18
  from langgraph_api.schema import (
langgraph_api/schema.py CHANGED
@@ -1,8 +1,10 @@
1
1
  from collections.abc import Sequence
2
2
  from datetime import datetime
3
- from typing import Any, Literal, Optional, TypedDict
3
+ from typing import Any, Literal, Optional
4
4
  from uuid import UUID
5
5
 
6
+ from typing_extensions import TypedDict
7
+
6
8
  from langgraph_api.serde import Fragment
7
9
 
8
10
  MetadataInput = dict[str, Any] | None
langgraph_api/worker.py CHANGED
@@ -3,11 +3,12 @@ import time
3
3
  from collections.abc import AsyncGenerator
4
4
  from contextlib import asynccontextmanager
5
5
  from datetime import UTC, datetime
6
- from typing import TypedDict, cast
6
+ from typing import cast
7
7
 
8
8
  import structlog
9
9
  from langgraph.pregel.debug import CheckpointPayload, TaskResultPayload
10
10
  from starlette.exceptions import HTTPException
11
+ from typing_extensions import TypedDict
11
12
 
12
13
  import langgraph_api.logging as lg_logging
13
14
  from langgraph_api.auth.custom import SimpleUser, normalize_user
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: langgraph-api
3
- Version: 0.2.92
3
+ Version: 0.2.95
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
@@ -11,7 +11,7 @@ Requires-Dist: httpx>=0.25.0
11
11
  Requires-Dist: jsonschema-rs<0.30,>=0.20.0
12
12
  Requires-Dist: langchain-core>=0.3.64
13
13
  Requires-Dist: langgraph-checkpoint>=2.0.23
14
- Requires-Dist: langgraph-runtime-inmem<0.5,>=0.4.0
14
+ Requires-Dist: langgraph-runtime-inmem<0.7,>=0.6.0
15
15
  Requires-Dist: langgraph-sdk>=0.1.71
16
16
  Requires-Dist: langgraph>=0.3.27
17
17
  Requires-Dist: langsmith>=0.3.45
@@ -1,12 +1,13 @@
1
- langgraph_api/__init__.py,sha256=kTqpr9DZFH7zgr4Skv7OAwoHWTP24R3bRDj-NAJr5jQ,23
1
+ langgraph_api/__init__.py,sha256=EHI7jWUI5UvuAnBQ8tm7j7Ud4Xzqu9b6iEixYwRIblc,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
5
5
  langgraph_api/command.py,sha256=3O9v3i0OPa96ARyJ_oJbLXkfO8rPgDhLCswgO9koTFA,768
6
- langgraph_api/config.py,sha256=MbsxCitbxI7EQgP7UfSv_MpdYyfQEyKIP1ILYr-MhzU,11889
6
+ langgraph_api/config.py,sha256=Nxhx6fOsxk_u-Aae54JAGn46JQ1wKXPjeu_KX_3d4wQ,11918
7
7
  langgraph_api/cron_scheduler.py,sha256=CiwZ-U4gDOdG9zl9dlr7mH50USUgNB2Fvb8YTKVRBN4,2625
8
8
  langgraph_api/errors.py,sha256=zlnl3xXIwVG0oGNKKpXf1an9Rn_SBDHSyhe53hU6aLw,1858
9
- langgraph_api/graph.py,sha256=pw_3jVZNe0stO5-Y8kLUuC8EJ5tFqdLu9fLpwUz4Hc4,23574
9
+ langgraph_api/feature_flags.py,sha256=ZoId5X1FpWGvHcKAduqDMRNEKks5Bt8Eswww_xoch5M,305
10
+ langgraph_api/graph.py,sha256=Q9tRf1WBaxFBOgs_orlMAlBVJM0-cpZVduknU_fbzRM,24235
10
11
  langgraph_api/http.py,sha256=L0leP5fH4NIiFgJd1YPMnTRWqrUUYq_4m5j558UwM5E,5612
11
12
  langgraph_api/http_metrics.py,sha256=VgM45yU1FkXuI9CIOE_astxAAu2G-OJ42BRbkcos_CQ,5555
12
13
  langgraph_api/logging.py,sha256=LL2LNuMYFrqDhG_KbyKy9AoAPghcdlFj2T50zMyPddk,4182
@@ -14,7 +15,7 @@ langgraph_api/metadata.py,sha256=lfovneEMLA5vTNa61weMkQkiZCtwo-qdwFwqNSj5qVs,663
14
15
  langgraph_api/patch.py,sha256=Dgs0PXHytekX4SUL6KsjjN0hHcOtGLvv1GRGbh6PswU,1408
15
16
  langgraph_api/queue_entrypoint.py,sha256=hC8j-A4cUxibusiiPJBlK0mkmChNZxNcXn5GVwL0yic,4889
16
17
  langgraph_api/route.py,sha256=4VBkJMeusfiZtLzyUaKm1HwLHTq0g15y2CRiRhM6xyA,4773
17
- langgraph_api/schema.py,sha256=a6it0h9ku4jrTXiW9MhnGok_wignyQ4cXBra67FiryM,5678
18
+ langgraph_api/schema.py,sha256=IdloGYognffSCZOFPujXE0QfNNlxQGd3BJbinYy5Q1c,5708
18
19
  langgraph_api/serde.py,sha256=0ALETUn582vNF-m0l_WOZGF_scL1VPA39fDkwMJQPrg,5187
19
20
  langgraph_api/server.py,sha256=Z_VL-kIphybTRDWBIqHMfRhgCmAFyTRqAGlgnHQF0Zg,6973
20
21
  langgraph_api/sse.py,sha256=SLdtZmTdh5D8fbWrQjuY9HYLd2dg8Rmi6ZMmFMVc2iE,4204
@@ -26,23 +27,23 @@ langgraph_api/traceblock.py,sha256=2aWS6TKGTcQ0G1fOtnjVrzkpeGvDsR0spDbfddEqgRU,5
26
27
  langgraph_api/utils.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
27
28
  langgraph_api/validation.py,sha256=zMuKmwUEBjBgFMwAaeLZmatwGVijKv2sOYtYg7gfRtc,4950
28
29
  langgraph_api/webhook.py,sha256=VCJp4dI5E1oSJ15XP34cnPiOi8Ya8Q1BnBwVGadOpLI,1636
29
- langgraph_api/worker.py,sha256=Zy6rHfcOoYg7FLui3KDMDMllslXFfjZ3z9uCgae-uMo,14216
30
+ langgraph_api/worker.py,sha256=LVvjvigurlDgpNjFcbAvRH7744fE01Lirrg2ZlHtORE,14245
30
31
  langgraph_api/api/__init__.py,sha256=WHy6oNLWtH1K7AxmmsU9RD-Vm6WP-Ov16xS8Ey9YCmQ,6090
31
32
  langgraph_api/api/assistants.py,sha256=w7nXjEknDVHSuP228S8ZLh4bG0nRGnSwVP9pECQOK90,16247
32
33
  langgraph_api/api/mcp.py,sha256=qe10ZRMN3f-Hli-9TI8nbQyWvMeBb72YB1PZVbyqBQw,14418
33
34
  langgraph_api/api/meta.py,sha256=fmc7btbtl5KVlU_vQ3Bj4J861IjlqmjBKNtnxSV-S-Q,4198
34
35
  langgraph_api/api/openapi.py,sha256=KToI2glOEsvrhDpwdScdBnL9xoLOqkTxx5zKq2pMuKQ,11957
35
- langgraph_api/api/runs.py,sha256=66x7Nywqr1OoMHHlG03OGuLlrbKYbfvLJepYLg6oXeE,19975
36
+ langgraph_api/api/runs.py,sha256=37phCkg8pgEQZQNqFlehIHmvVbdeD8A1ojV7Vk7Mm08,19944
36
37
  langgraph_api/api/store.py,sha256=TSeMiuMfrifmEnEbL0aObC2DPeseLlmZvAMaMzPgG3Y,5535
37
38
  langgraph_api/api/threads.py,sha256=ogMKmEoiycuaV3fa5kpupDohJ7fwUOfVczt6-WSK4FE,9322
38
- langgraph_api/api/ui.py,sha256=2nlipYV2nUGR4T9pceaAbgN1lS3-T2zPBh7Nv3j9eZQ,2479
39
+ langgraph_api/api/ui.py,sha256=17QrRy2XVzP7x_0RdRw7pmSv-n1lmnb54byHCGGeNhM,2490
39
40
  langgraph_api/auth/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
40
41
  langgraph_api/auth/custom.py,sha256=ZtNSQ4hIldbd2HvRsilwKzN_hjCWIiIOHClmYyPi8FM,22206
41
42
  langgraph_api/auth/middleware.py,sha256=jDA4t41DUoAArEY_PNoXesIUBJ0nGhh85QzRdn5EPD0,1916
42
43
  langgraph_api/auth/noop.py,sha256=Bk6Nf3p8D_iMVy_OyfPlyiJp_aEwzL-sHrbxoXpCbac,586
43
44
  langgraph_api/auth/studio_user.py,sha256=fojJpexdIZYI1w3awiqOLSwMUiK_M_3p4mlfQI0o-BE,454
44
45
  langgraph_api/auth/langsmith/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
45
- langgraph_api/auth/langsmith/backend.py,sha256=jRD9WL7OhxnUurMt7v1vziIUwpzkE1hR-xmRaRQmpvw,3617
46
+ langgraph_api/auth/langsmith/backend.py,sha256=36nQnVb9VtNvSnLiNYWAI9o9H74I-mSN2X-FrWoj0QA,3646
46
47
  langgraph_api/auth/langsmith/client.py,sha256=eKchvAom7hdkUXauD8vHNceBDDUijrFgdTV8bKd7x4Q,3998
47
48
  langgraph_api/js/.gitignore,sha256=l5yI6G_V6F1600I1IjiUKn87f4uYIrBAYU1MOyBBhg4,59
48
49
  langgraph_api/js/.prettierrc,sha256=0es3ovvyNIqIw81rPQsdt1zCQcOdBqyR_DMbFE4Ifms,19
@@ -50,12 +51,12 @@ langgraph_api/js/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,
50
51
  langgraph_api/js/base.py,sha256=gjY6K8avI03OrI-Hy6a311fQ_EG5r_x8hUYlc7uqxdE,534
51
52
  langgraph_api/js/build.mts,sha256=bRQo11cglDFXlLN7Y48CQPTSMLenp7MqIWuP1DkSIo0,3139
52
53
  langgraph_api/js/client.http.mts,sha256=AGA-p8J85IcNh2oXZjDxHQ4PnQdJmt-LPcpZp6j0Cws,4687
53
- langgraph_api/js/client.mts,sha256=Lyug2cIhW6hlxSaxZV_7KPe1aBLQ47oijbqL26joTT8,31046
54
+ langgraph_api/js/client.mts,sha256=5PjWSfNHGRNbrlFH4zlFM0lfGlvK0hBARa6qcl3gC5o,30958
54
55
  langgraph_api/js/errors.py,sha256=Cm1TKWlUCwZReDC5AQ6SgNIVGD27Qov2xcgHyf8-GXo,361
55
56
  langgraph_api/js/global.d.ts,sha256=j4GhgtQSZ5_cHzjSPcHgMJ8tfBThxrH-pUOrrJGteOU,196
56
57
  langgraph_api/js/package.json,sha256=BpNAO88mbE-Gv4WzQfj1TLktCWGqm6XBqI892ObuOUw,1333
57
58
  langgraph_api/js/remote.py,sha256=B_0cP34AGTW9rL_hJyKIh3P6Z4TvNYNNyc7S2_SOWt4,36880
58
- langgraph_api/js/schema.py,sha256=7idnv7URlYUdSNMBXQcw7E4SxaPxCq_Oxwnlml8q5ik,408
59
+ langgraph_api/js/schema.py,sha256=M4fLtr50O1jck8H1hm_0W4cZOGYGdkrB7riLyCes4oY,438
59
60
  langgraph_api/js/sse.py,sha256=lsfp4nyJyA1COmlKG9e2gJnTttf_HGCB5wyH8OZBER8,4105
60
61
  langgraph_api/js/traceblock.mts,sha256=QtGSN5VpzmGqDfbArrGXkMiONY94pMQ5CgzetT_bKYg,761
61
62
  langgraph_api/js/tsconfig.json,sha256=imCYqVnqFpaBoZPx8k1nO4slHIWBFsSlmCYhO73cpBs,341
@@ -73,7 +74,7 @@ langgraph_api/middleware/http_logger.py,sha256=uroMCag49-uPHTt8K3glkl-0RnWL20YEg
73
74
  langgraph_api/middleware/private_network.py,sha256=eYgdyU8AzU2XJu362i1L8aSFoQRiV7_aLBPw7_EgeqI,2111
74
75
  langgraph_api/middleware/request_id.py,sha256=SDj3Yi3WvTbFQ2ewrPQBjAV8sYReOJGeIiuoHeZpR9g,1242
75
76
  langgraph_api/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
76
- langgraph_api/models/run.py,sha256=AAeny3Pjhkw6RCcV5fri8GWjH4Vcy522dLbki6Qbzxo,14523
77
+ langgraph_api/models/run.py,sha256=pIa26KUz6n1naxIJQtKSW7CghHJltSlkQhK9KDagEuQ,14552
77
78
  langgraph_api/tunneling/cloudflare.py,sha256=iKb6tj-VWPlDchHFjuQyep2Dpb-w2NGfJKt-WJG9LH0,3650
78
79
  langgraph_api/utils/__init__.py,sha256=92mSti9GfGdMRRWyESKQW5yV-75Z9icGHnIrBYvdypU,3619
79
80
  langgraph_api/utils/cache.py,sha256=SrtIWYibbrNeZzLXLUGBFhJPkMVNQnVxR5giiYGHEfI,1810
@@ -93,8 +94,8 @@ langgraph_runtime/store.py,sha256=7mowndlsIroGHv3NpTSOZDJR0lCuaYMBoTnTrewjslw,11
93
94
  LICENSE,sha256=ZPwVR73Biwm3sK6vR54djCrhaRiM4cAD2zvOQZV8Xis,3859
94
95
  logging.json,sha256=3RNjSADZmDq38eHePMm1CbP6qZ71AmpBtLwCmKU9Zgo,379
95
96
  openapi.json,sha256=p5tn_cNRiFA0HN3L6JfC9Nm16Hgv-BxvAQcJymKhVWI,143296
96
- langgraph_api-0.2.92.dist-info/METADATA,sha256=4fQhlIf7yoDfMT2FXp11XjrzePUaNOqXunwyKQ92EZc,3891
97
- langgraph_api-0.2.92.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
98
- langgraph_api-0.2.92.dist-info/entry_points.txt,sha256=hGedv8n7cgi41PypMfinwS_HfCwA7xJIfS0jAp8htV8,78
99
- langgraph_api-0.2.92.dist-info/licenses/LICENSE,sha256=ZPwVR73Biwm3sK6vR54djCrhaRiM4cAD2zvOQZV8Xis,3859
100
- langgraph_api-0.2.92.dist-info/RECORD,,
97
+ langgraph_api-0.2.95.dist-info/METADATA,sha256=gP3sm3xflctI93zu9c9D-Rgo_5xxlPte7cKXBK-1k-w,3891
98
+ langgraph_api-0.2.95.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
99
+ langgraph_api-0.2.95.dist-info/entry_points.txt,sha256=hGedv8n7cgi41PypMfinwS_HfCwA7xJIfS0jAp8htV8,78
100
+ langgraph_api-0.2.95.dist-info/licenses/LICENSE,sha256=ZPwVR73Biwm3sK6vR54djCrhaRiM4cAD2zvOQZV8Xis,3859
101
+ langgraph_api-0.2.95.dist-info/RECORD,,