langgraph-api 0.2.10__tar.gz → 0.2.12__tar.gz
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-0.2.10 → langgraph_api-0.2.12}/PKG-INFO +1 -1
- langgraph_api-0.2.12/langgraph_api/__init__.py +1 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/api/runs.py +6 -6
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/config.py +2 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/route.py +18 -9
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/pyproject.toml +1 -1
- langgraph_api-0.2.10/langgraph_api/__init__.py +0 -1
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/LICENSE +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/README.md +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/api/__init__.py +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/api/assistants.py +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/api/mcp.py +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/api/meta.py +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/api/openapi.py +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/api/store.py +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/api/threads.py +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/api/ui.py +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/asyncio.py +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/auth/__init__.py +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/auth/custom.py +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/auth/langsmith/__init__.py +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/auth/langsmith/backend.py +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/auth/langsmith/client.py +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/auth/middleware.py +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/auth/noop.py +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/auth/studio_user.py +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/cli.py +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/command.py +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/cron_scheduler.py +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/errors.py +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/graph.py +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/http.py +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/js/.gitignore +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/js/.prettierrc +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/js/__init__.py +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/js/base.py +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/js/build.mts +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/js/client.http.mts +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/js/client.mts +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/js/errors.py +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/js/global.d.ts +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/js/package.json +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/js/remote.py +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/js/schema.py +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/js/src/graph.mts +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/js/src/load.hooks.mjs +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/js/src/preload.mjs +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/js/src/utils/files.mts +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/js/src/utils/importMap.mts +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/js/src/utils/pythonSchemas.mts +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/js/src/utils/serde.mts +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/js/sse.py +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/js/tests/api.test.mts +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/js/tests/auth.test.mts +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/js/tests/compose-postgres.auth.yml +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/js/tests/compose-postgres.yml +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/js/tests/graphs/.gitignore +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/js/tests/graphs/agent.css +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/js/tests/graphs/agent.mts +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/js/tests/graphs/agent.ui.tsx +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/js/tests/graphs/agent_simple.mts +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/js/tests/graphs/auth.mts +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/js/tests/graphs/command.mts +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/js/tests/graphs/delay.mts +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/js/tests/graphs/dynamic.mts +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/js/tests/graphs/error.mts +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/js/tests/graphs/http.mts +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/js/tests/graphs/langgraph.json +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/js/tests/graphs/nested.mts +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/js/tests/graphs/package.json +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/js/tests/graphs/weather.mts +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/js/tests/graphs/yarn.lock +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/js/tests/utils.mts +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/js/tsconfig.json +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/js/ui.py +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/js/yarn.lock +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/logging.py +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/metadata.py +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/middleware/__init__.py +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/middleware/http_logger.py +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/middleware/private_network.py +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/models/__init__.py +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/models/run.py +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/patch.py +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/queue_entrypoint.py +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/schema.py +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/serde.py +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/server.py +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/sse.py +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/state.py +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/stream.py +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/thread_ttl.py +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/tunneling/cloudflare.py +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/utils.py +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/validation.py +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/webhook.py +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/worker.py +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_license/__init__.py +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_license/validation.py +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_runtime/__init__.py +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/logging.json +0 -0
- {langgraph_api-0.2.10 → langgraph_api-0.2.12}/openapi.json +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.2.12"
|
|
@@ -285,7 +285,7 @@ async def wait_run_stateless(request: ApiRequest):
|
|
|
285
285
|
|
|
286
286
|
|
|
287
287
|
@retry_db
|
|
288
|
-
async def
|
|
288
|
+
async def list_runs(
|
|
289
289
|
request: ApiRequest,
|
|
290
290
|
):
|
|
291
291
|
"""List all runs for a thread."""
|
|
@@ -312,7 +312,7 @@ async def list_runs_http(
|
|
|
312
312
|
|
|
313
313
|
|
|
314
314
|
@retry_db
|
|
315
|
-
async def
|
|
315
|
+
async def get_run(request: ApiRequest):
|
|
316
316
|
"""Get a run by ID."""
|
|
317
317
|
thread_id = request.path_params["thread_id"]
|
|
318
318
|
run_id = request.path_params["run_id"]
|
|
@@ -349,7 +349,7 @@ async def join_run(request: ApiRequest):
|
|
|
349
349
|
|
|
350
350
|
|
|
351
351
|
@retry_db
|
|
352
|
-
async def
|
|
352
|
+
async def join_run_stream(request: ApiRequest):
|
|
353
353
|
"""Wait for a run to finish."""
|
|
354
354
|
thread_id = request.path_params["thread_id"]
|
|
355
355
|
run_id = request.path_params["run_id"]
|
|
@@ -541,11 +541,11 @@ runs_routes = [
|
|
|
541
541
|
ApiRoute("/threads/{thread_id}/runs/{run_id}/join", join_run, methods=["GET"]),
|
|
542
542
|
ApiRoute(
|
|
543
543
|
"/threads/{thread_id}/runs/{run_id}/stream",
|
|
544
|
-
|
|
544
|
+
join_run_stream,
|
|
545
545
|
methods=["GET"],
|
|
546
546
|
),
|
|
547
547
|
ApiRoute("/threads/{thread_id}/runs/{run_id}/cancel", cancel_run, methods=["POST"]),
|
|
548
|
-
ApiRoute("/threads/{thread_id}/runs/{run_id}",
|
|
548
|
+
ApiRoute("/threads/{thread_id}/runs/{run_id}", get_run, methods=["GET"]),
|
|
549
549
|
ApiRoute("/threads/{thread_id}/runs/{run_id}", delete_run, methods=["DELETE"]),
|
|
550
550
|
ApiRoute("/threads/{thread_id}/runs/stream", stream_run, methods=["POST"]),
|
|
551
551
|
ApiRoute("/threads/{thread_id}/runs/wait", wait_run, methods=["POST"]),
|
|
@@ -557,7 +557,7 @@ runs_routes = [
|
|
|
557
557
|
if config.FF_CRONS_ENABLED and plus_features_enabled()
|
|
558
558
|
else None
|
|
559
559
|
),
|
|
560
|
-
ApiRoute("/threads/{thread_id}/runs",
|
|
560
|
+
ApiRoute("/threads/{thread_id}/runs", list_runs, methods=["GET"]),
|
|
561
561
|
(
|
|
562
562
|
ApiRoute("/runs/crons/{cron_id}", delete_cron, methods=["DELETE"])
|
|
563
563
|
if config.FF_CRONS_ENABLED and plus_features_enabled()
|
|
@@ -148,6 +148,8 @@ STATS_INTERVAL_SECS = env("STATS_INTERVAL_SECS", cast=int, default=60)
|
|
|
148
148
|
DATABASE_URI = env("DATABASE_URI", cast=str, default=getenv("POSTGRES_URI", undefined))
|
|
149
149
|
MIGRATIONS_PATH = env("MIGRATIONS_PATH", cast=str, default="/storage/migrations")
|
|
150
150
|
|
|
151
|
+
POSTGRES_POOL_MAX_SIZE = env("LANGGRAPH_POSTGRES_POOL_MAX_SIZE", cast=int, default=150)
|
|
152
|
+
|
|
151
153
|
|
|
152
154
|
def _get_encryption_key(key_str: str | None):
|
|
153
155
|
if not key_str:
|
|
@@ -9,16 +9,25 @@ from starlette._utils import is_async_callable
|
|
|
9
9
|
from starlette.concurrency import run_in_threadpool
|
|
10
10
|
from starlette.middleware import Middleware
|
|
11
11
|
from starlette.requests import Request
|
|
12
|
-
from starlette.responses import JSONResponse
|
|
12
|
+
from starlette.responses import JSONResponse
|
|
13
13
|
from starlette.routing import Route, compile_path, get_name
|
|
14
14
|
from starlette.types import ASGIApp, Receive, Scope, Send
|
|
15
15
|
|
|
16
16
|
from langgraph_api.serde import json_dumpb
|
|
17
17
|
from langgraph_api.utils import get_auth_ctx, with_user
|
|
18
18
|
|
|
19
|
+
SchemaType = (
|
|
20
|
+
jsonschema_rs.Draft4Validator
|
|
21
|
+
| jsonschema_rs.Draft6Validator
|
|
22
|
+
| jsonschema_rs.Draft7Validator
|
|
23
|
+
| jsonschema_rs.Draft201909Validator
|
|
24
|
+
| jsonschema_rs.Draft202012Validator
|
|
25
|
+
| None
|
|
26
|
+
)
|
|
27
|
+
|
|
19
28
|
|
|
20
29
|
def api_request_response(
|
|
21
|
-
func: typing.Callable[[Request], typing.Awaitable[
|
|
30
|
+
func: typing.Callable[[Request], typing.Awaitable[ASGIApp] | ASGIApp],
|
|
22
31
|
) -> ASGIApp:
|
|
23
32
|
"""
|
|
24
33
|
Takes a function or coroutine `func(request) -> response`,
|
|
@@ -30,9 +39,11 @@ def api_request_response(
|
|
|
30
39
|
|
|
31
40
|
async def app(scope: Scope, receive: Receive, send: Send) -> None:
|
|
32
41
|
if is_async_callable(func):
|
|
33
|
-
response = await func(request)
|
|
42
|
+
response: ASGIApp = await func(request)
|
|
34
43
|
else:
|
|
35
|
-
response = await run_in_threadpool(
|
|
44
|
+
response = await run_in_threadpool(
|
|
45
|
+
typing.cast(typing.Callable[[Request], ASGIApp], func), request
|
|
46
|
+
)
|
|
36
47
|
await response(scope, receive, send)
|
|
37
48
|
|
|
38
49
|
await wrap_app_handling_exceptions(app, request)(scope, receive, send)
|
|
@@ -45,9 +56,7 @@ class ApiResponse(JSONResponse):
|
|
|
45
56
|
return json_dumpb(content)
|
|
46
57
|
|
|
47
58
|
|
|
48
|
-
def _json_loads(
|
|
49
|
-
content: bytearray, schema: jsonschema_rs.Draft4Validator | None
|
|
50
|
-
) -> typing.Any:
|
|
59
|
+
def _json_loads(content: bytearray, schema: SchemaType) -> typing.Any:
|
|
51
60
|
json = orjson.loads(content)
|
|
52
61
|
if schema is not None:
|
|
53
62
|
schema.validate(json)
|
|
@@ -55,7 +64,7 @@ def _json_loads(
|
|
|
55
64
|
|
|
56
65
|
|
|
57
66
|
class ApiRequest(Request):
|
|
58
|
-
async def body(self) ->
|
|
67
|
+
async def body(self) -> bytearray:
|
|
59
68
|
if not hasattr(self, "_body"):
|
|
60
69
|
chunks = bytearray()
|
|
61
70
|
async for chunk in self.stream():
|
|
@@ -63,7 +72,7 @@ class ApiRequest(Request):
|
|
|
63
72
|
self._body = chunks
|
|
64
73
|
return self._body
|
|
65
74
|
|
|
66
|
-
async def json(self, schema:
|
|
75
|
+
async def json(self, schema: SchemaType = None) -> typing.Any:
|
|
67
76
|
if not hasattr(self, "_json"):
|
|
68
77
|
body = await self.body()
|
|
69
78
|
self._json = await run_in_threadpool(_json_loads, body, schema)
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.2.10"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/js/tests/compose-postgres.auth.yml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{langgraph_api-0.2.10 → langgraph_api-0.2.12}/langgraph_api/js/tests/graphs/agent_simple.mts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|