langgraph-api 0.1.7__py3-none-any.whl → 0.1.9__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/api/__init__.py +1 -3
- langgraph_api/api/openapi.py +3 -1
- langgraph_api/config.py +1 -0
- langgraph_api/js/client.http.mts +7 -1
- langgraph_api/js/package.json +1 -1
- langgraph_api/js/tests/api.test.mts +17 -0
- langgraph_api/js/tests/graphs/http.mts +11 -1
- langgraph_api/js/tests/graphs/package.json +1 -1
- langgraph_api/js/tests/graphs/yarn.lock +4 -4
- langgraph_api/js/yarn.lock +4 -4
- {langgraph_api-0.1.7.dist-info → langgraph_api-0.1.9.dist-info}/METADATA +1 -1
- {langgraph_api-0.1.7.dist-info → langgraph_api-0.1.9.dist-info}/RECORD +16 -16
- {langgraph_api-0.1.7.dist-info → langgraph_api-0.1.9.dist-info}/LICENSE +0 -0
- {langgraph_api-0.1.7.dist-info → langgraph_api-0.1.9.dist-info}/WHEEL +0 -0
- {langgraph_api-0.1.7.dist-info → langgraph_api-0.1.9.dist-info}/entry_points.txt +0 -0
langgraph_api/__init__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.1.
|
|
1
|
+
__version__ = "0.1.9"
|
langgraph_api/api/__init__.py
CHANGED
|
@@ -18,7 +18,7 @@ from langgraph_api.api.store import store_routes
|
|
|
18
18
|
from langgraph_api.api.threads import threads_routes
|
|
19
19
|
from langgraph_api.api.ui import ui_routes
|
|
20
20
|
from langgraph_api.auth.middleware import auth_middleware
|
|
21
|
-
from langgraph_api.config import HTTP_CONFIG, MIGRATIONS_PATH
|
|
21
|
+
from langgraph_api.config import HTTP_CONFIG, MIGRATIONS_PATH, MOUNT_PREFIX
|
|
22
22
|
from langgraph_api.graph import js_bg_tasks
|
|
23
23
|
from langgraph_api.js.base import is_js_path
|
|
24
24
|
from langgraph_api.validation import DOCS_HTML
|
|
@@ -44,8 +44,6 @@ async def openapi(request: Request):
|
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
async def docs(request: Request):
|
|
47
|
-
from langgraph_api.config import MOUNT_PREFIX
|
|
48
|
-
|
|
49
47
|
return HTMLResponse(DOCS_HTML.format(mount_prefix=MOUNT_PREFIX or ""))
|
|
50
48
|
|
|
51
49
|
|
langgraph_api/api/openapi.py
CHANGED
|
@@ -5,7 +5,7 @@ from functools import lru_cache
|
|
|
5
5
|
|
|
6
6
|
import orjson
|
|
7
7
|
|
|
8
|
-
from langgraph_api.config import LANGGRAPH_AUTH, LANGGRAPH_AUTH_TYPE
|
|
8
|
+
from langgraph_api.config import LANGGRAPH_AUTH, LANGGRAPH_AUTH_TYPE, MOUNT_PREFIX
|
|
9
9
|
from langgraph_api.graph import GRAPHS
|
|
10
10
|
from langgraph_api.validation import openapi
|
|
11
11
|
|
|
@@ -78,6 +78,8 @@ def get_openapi_spec() -> str:
|
|
|
78
78
|
final = openapi
|
|
79
79
|
if CUSTOM_OPENAPI_SPEC:
|
|
80
80
|
final = merge_openapi_specs(openapi, CUSTOM_OPENAPI_SPEC)
|
|
81
|
+
if MOUNT_PREFIX:
|
|
82
|
+
final["servers"] = [{"url": MOUNT_PREFIX}]
|
|
81
83
|
return orjson.dumps(final)
|
|
82
84
|
|
|
83
85
|
|
langgraph_api/config.py
CHANGED
|
@@ -159,6 +159,7 @@ REDIS_URI = env("REDIS_URI", cast=str)
|
|
|
159
159
|
REDIS_CLUSTER = env("REDIS_CLUSTER", cast=bool, default=False)
|
|
160
160
|
REDIS_MAX_CONNECTIONS = env("REDIS_MAX_CONNECTIONS", cast=int, default=500)
|
|
161
161
|
REDIS_CONNECT_TIMEOUT = env("REDIS_CONNECT_TIMEOUT", cast=float, default=10.0)
|
|
162
|
+
REDIS_KEY_PREFIX = env("REDIS_KEY_PREFIX", cast=str, default="")
|
|
162
163
|
|
|
163
164
|
# server
|
|
164
165
|
ALLOW_PRIVATE_NETWORK = env("ALLOW_PRIVATE_NETWORK", cast=bool, default=False)
|
langgraph_api/js/client.http.mts
CHANGED
|
@@ -69,7 +69,7 @@ const wrapHonoApp = (app: Hono) => {
|
|
|
69
69
|
// alongside any accumulated headers from middlewares.
|
|
70
70
|
// TODO: figure out how to compose the user-land `notFound` handler.
|
|
71
71
|
newApp.notFound(async (c) => {
|
|
72
|
-
//
|
|
72
|
+
// Send the request body back to the Python server
|
|
73
73
|
// Use the cached body in-case the user mutated the body
|
|
74
74
|
let payload: any = null;
|
|
75
75
|
try {
|
|
@@ -127,6 +127,12 @@ async function main() {
|
|
|
127
127
|
.parse(JSON.parse(process.env.LANGGRAPH_HTTP ?? "{}"));
|
|
128
128
|
|
|
129
129
|
if (!http.app) throw new Error("No HTTP app path provided");
|
|
130
|
+
|
|
131
|
+
// register loopback
|
|
132
|
+
const urlSmb = Symbol.for("langgraph_api:url");
|
|
133
|
+
const global = globalThis as unknown as { [urlSmb]?: string };
|
|
134
|
+
global[urlSmb] = `http://localhost:${process.env.PORT || 9123}`;
|
|
135
|
+
|
|
130
136
|
const app = await registerHttp(http.app, { cwd: process.cwd() });
|
|
131
137
|
|
|
132
138
|
serve({ fetch: app.fetch, hostname: "localhost", port: HTTP_PORT }, (c) =>
|
langgraph_api/js/package.json
CHANGED
|
@@ -2080,3 +2080,20 @@ it("custom routes - mutate request body", async () => {
|
|
|
2080
2080
|
]),
|
|
2081
2081
|
});
|
|
2082
2082
|
});
|
|
2083
|
+
|
|
2084
|
+
it("custom routes - langgraph", async () => {
|
|
2085
|
+
const fetcher = async (...args: Parameters<typeof fetch>) => {
|
|
2086
|
+
const res = await fetch(...args);
|
|
2087
|
+
if (!res.ok) throw new Error(`${res.status} ${res.statusText}`);
|
|
2088
|
+
return { json: await res.json(), headers: res.headers };
|
|
2089
|
+
};
|
|
2090
|
+
|
|
2091
|
+
const res = await fetcher(new URL("/custom/client", API_URL));
|
|
2092
|
+
expect(res.json).toEqual({
|
|
2093
|
+
result: {
|
|
2094
|
+
messages: expect.arrayContaining([
|
|
2095
|
+
expect.objectContaining({ content: "input" }),
|
|
2096
|
+
]),
|
|
2097
|
+
},
|
|
2098
|
+
});
|
|
2099
|
+
});
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { Hono } from "hono";
|
|
2
2
|
import { HTTPException } from "hono/http-exception";
|
|
3
3
|
import { streamText } from "hono/streaming";
|
|
4
|
+
import { Client } from "@langchain/langgraph-sdk";
|
|
4
5
|
|
|
5
6
|
let WEBHOOK_PAYLOAD: Record<string, unknown>;
|
|
6
7
|
|
|
7
8
|
export const app = new Hono<{
|
|
8
|
-
Variables: {
|
|
9
|
+
Variables: {
|
|
10
|
+
body: string | ArrayBuffer | ReadableStream | null;
|
|
11
|
+
};
|
|
9
12
|
}>()
|
|
10
13
|
.use(async (c, next) => {
|
|
11
14
|
if (c.req.query("interrupt") != null) {
|
|
@@ -34,6 +37,13 @@ export const app = new Hono<{
|
|
|
34
37
|
|
|
35
38
|
await next();
|
|
36
39
|
})
|
|
40
|
+
.get("/custom/client", async (c) => {
|
|
41
|
+
const result = await new Client().runs.wait(null, "agent_simple", {
|
|
42
|
+
input: { messages: [{ role: "human", content: "input" }] },
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
return c.json({ result });
|
|
46
|
+
})
|
|
37
47
|
.get("/custom/my-route", (c) =>
|
|
38
48
|
c.json(
|
|
39
49
|
{ foo: "bar" },
|
|
@@ -32,10 +32,10 @@
|
|
|
32
32
|
dependencies:
|
|
33
33
|
uuid "^10.0.0"
|
|
34
34
|
|
|
35
|
-
"@langchain/langgraph-sdk@^0.0.
|
|
36
|
-
version "0.0.
|
|
37
|
-
resolved "https://registry.yarnpkg.com/@langchain/langgraph-sdk/-/langgraph-sdk-0.0.
|
|
38
|
-
integrity sha512-
|
|
35
|
+
"@langchain/langgraph-sdk@^0.0.67", "@langchain/langgraph-sdk@~0.0.32":
|
|
36
|
+
version "0.0.67"
|
|
37
|
+
resolved "https://registry.yarnpkg.com/@langchain/langgraph-sdk/-/langgraph-sdk-0.0.67.tgz#d856110727669f59cf9367cea99d88479de164d4"
|
|
38
|
+
integrity sha512-JWa0OuiXPoFztmBleUj6N00snuZt80Df6BSMUEjBfMSRNVPn7yiyyz/QTkzuW1LqqVZKPI4O8Bpimnw2xIg3BA==
|
|
39
39
|
dependencies:
|
|
40
40
|
"@types/json-schema" "^7.0.15"
|
|
41
41
|
p-queue "^6.6.2"
|
langgraph_api/js/yarn.lock
CHANGED
|
@@ -235,10 +235,10 @@
|
|
|
235
235
|
dependencies:
|
|
236
236
|
uuid "^10.0.0"
|
|
237
237
|
|
|
238
|
-
"@langchain/langgraph-sdk@^0.0.
|
|
239
|
-
version "0.0.
|
|
240
|
-
resolved "https://registry.yarnpkg.com/@langchain/langgraph-sdk/-/langgraph-sdk-0.0.
|
|
241
|
-
integrity sha512-
|
|
238
|
+
"@langchain/langgraph-sdk@^0.0.67", "@langchain/langgraph-sdk@~0.0.32":
|
|
239
|
+
version "0.0.67"
|
|
240
|
+
resolved "https://registry.yarnpkg.com/@langchain/langgraph-sdk/-/langgraph-sdk-0.0.67.tgz#d856110727669f59cf9367cea99d88479de164d4"
|
|
241
|
+
integrity sha512-JWa0OuiXPoFztmBleUj6N00snuZt80Df6BSMUEjBfMSRNVPn7yiyyz/QTkzuW1LqqVZKPI4O8Bpimnw2xIg3BA==
|
|
242
242
|
dependencies:
|
|
243
243
|
"@types/json-schema" "^7.0.15"
|
|
244
244
|
p-queue "^6.6.2"
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
LICENSE,sha256=ZPwVR73Biwm3sK6vR54djCrhaRiM4cAD2zvOQZV8Xis,3859
|
|
2
|
-
langgraph_api/__init__.py,sha256=
|
|
3
|
-
langgraph_api/api/__init__.py,sha256=
|
|
2
|
+
langgraph_api/__init__.py,sha256=XIaxbMbyiP-L3kguR1GhxirFblTXiHR1lMfDVITvHUI,22
|
|
3
|
+
langgraph_api/api/__init__.py,sha256=IKKMrC5gCHTzjprbg8jgZDrAJRuqJfSUgEkZAgh3l-M,5771
|
|
4
4
|
langgraph_api/api/assistants.py,sha256=i-nxkScUB2g8bTVGtQIp1psABXlaY1aVx9pkB_UiRH8,14353
|
|
5
5
|
langgraph_api/api/mcp.py,sha256=KbR19dtFCpJEiKYj3IfepAuJij8YZVELuVp7JY_yu_o,13754
|
|
6
6
|
langgraph_api/api/meta.py,sha256=sTgkhE-DaFWpERG6F7KelZfDsmJAiVc4j5dg50tDkSo,2950
|
|
7
|
-
langgraph_api/api/openapi.py,sha256=
|
|
7
|
+
langgraph_api/api/openapi.py,sha256=OGwzPpYO4e98iqtgL7UEfzI6jP4zXahJ1R-7VgOSZeg,11046
|
|
8
8
|
langgraph_api/api/runs.py,sha256=dhHZ3xu7V0anftqzXaOYnhVEryJpVeqzu60MFiUw4u8,18010
|
|
9
9
|
langgraph_api/api/store.py,sha256=G4Fm8hgFLlJUW5_ekLS_IOgCfpFy-TK9uq5r9QTOELQ,5447
|
|
10
10
|
langgraph_api/api/threads.py,sha256=EvKJDnZDWutKoB5KoTP40NPEqG5LJ-Iw97TLYHkhLbw,9163
|
|
@@ -20,7 +20,7 @@ langgraph_api/auth/noop.py,sha256=Bk6Nf3p8D_iMVy_OyfPlyiJp_aEwzL-sHrbxoXpCbac,58
|
|
|
20
20
|
langgraph_api/auth/studio_user.py,sha256=FzFQRROKDlA9JjtBuwyZvk6Mbwno5M9RVYjDO6FU3F8,186
|
|
21
21
|
langgraph_api/cli.py,sha256=NQSHyGbsr8I5xqEmbgDxADgCxbqWrcJRvT69JfGP3ms,13452
|
|
22
22
|
langgraph_api/command.py,sha256=3O9v3i0OPa96ARyJ_oJbLXkfO8rPgDhLCswgO9koTFA,768
|
|
23
|
-
langgraph_api/config.py,sha256=
|
|
23
|
+
langgraph_api/config.py,sha256=GWXgIDVPtpY7MBiAQMg7iluDzl7z6VYUsX_I1payq4k,10618
|
|
24
24
|
langgraph_api/cron_scheduler.py,sha256=i87j4pJrcsmsqMKeKUs69gaAjrGaSM3pM3jnXdN5JDQ,2630
|
|
25
25
|
langgraph_api/errors.py,sha256=Bu_i5drgNTyJcLiyrwVE_6-XrSU50BHf9TDpttki9wQ,1690
|
|
26
26
|
langgraph_api/graph.py,sha256=OMvYH6xO5KXwPxTSZ3e_yQZXDmT8nVsa0iqOWqKqYaw,21477
|
|
@@ -30,11 +30,11 @@ langgraph_api/js/.prettierrc,sha256=r08GtR4CPFQkArPYy10eMUbrpTvGDVNeoZRvaeZu0Kc,
|
|
|
30
30
|
langgraph_api/js/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
31
31
|
langgraph_api/js/base.py,sha256=udYS5_OmmJI_d7kEUv0H4FINprZOW6tdXRkKDEdzNvc,469
|
|
32
32
|
langgraph_api/js/build.mts,sha256=4xcjo9rufSPUnnihdYp1EnDPSoaDQDV6aN8_UMjKp-g,1916
|
|
33
|
-
langgraph_api/js/client.http.mts,sha256=
|
|
33
|
+
langgraph_api/js/client.http.mts,sha256=AGA-p8J85IcNh2oXZjDxHQ4PnQdJmt-LPcpZp6j0Cws,4687
|
|
34
34
|
langgraph_api/js/client.mts,sha256=7v5BcWsR5w6wGCsxhm6xryBgI-5vfu2Or1YmT-GdKyY,28766
|
|
35
35
|
langgraph_api/js/errors.py,sha256=Cm1TKWlUCwZReDC5AQ6SgNIVGD27Qov2xcgHyf8-GXo,361
|
|
36
36
|
langgraph_api/js/global.d.ts,sha256=j4GhgtQSZ5_cHzjSPcHgMJ8tfBThxrH-pUOrrJGteOU,196
|
|
37
|
-
langgraph_api/js/package.json,sha256=
|
|
37
|
+
langgraph_api/js/package.json,sha256=UiJmCaT-N5Bl8NiotYYYMNZDb9ibz4LqRKgeyMfHisc,1289
|
|
38
38
|
langgraph_api/js/remote.py,sha256=pnyq3oGtMX3kGaBLU-lhMf_kKvc1a1324Z3e_KIKAD0,35117
|
|
39
39
|
langgraph_api/js/schema.py,sha256=7idnv7URlYUdSNMBXQcw7E4SxaPxCq_Oxwnlml8q5ik,408
|
|
40
40
|
langgraph_api/js/src/graph.mts,sha256=g86jOvbHj1B0o1jatBc2X5_JEZW2DSNwgUJ_kw1k8Cw,3569
|
|
@@ -48,7 +48,7 @@ langgraph_api/js/src/utils/importMap.mts,sha256=pX4TGOyUpuuWF82kXcxcv3-8mgusRezO
|
|
|
48
48
|
langgraph_api/js/src/utils/pythonSchemas.mts,sha256=98IW7Z_VP7L_CHNRMb3_MsiV3BgLE2JsWQY_PQcRR3o,685
|
|
49
49
|
langgraph_api/js/src/utils/serde.mts,sha256=OuyyO9btvwWd55rU_H4x91dFEJiaPxL-lL9O6Zgo908,742
|
|
50
50
|
langgraph_api/js/sse.py,sha256=lsfp4nyJyA1COmlKG9e2gJnTttf_HGCB5wyH8OZBER8,4105
|
|
51
|
-
langgraph_api/js/tests/api.test.mts,sha256=
|
|
51
|
+
langgraph_api/js/tests/api.test.mts,sha256=ZWOFnEPxXQgSOvQjUFNI1mof2civ7RB6980_JuWFr0E,66808
|
|
52
52
|
langgraph_api/js/tests/auth.test.mts,sha256=A8JXfEep6S4jzduoSZeRQkqq9WsFbVE8Bvi3Hj_zx2w,21600
|
|
53
53
|
langgraph_api/js/tests/compose-postgres.auth.yml,sha256=iPfJbCeYZdV6GiRLiDn_f7qgpG4TyyGaQ4lV-ZXr6Qk,1768
|
|
54
54
|
langgraph_api/js/tests/compose-postgres.yml,sha256=w4B3YRS0QEnTcZH2-MY0DYvR_c5GcER0uDa1Ga_knf8,1960
|
|
@@ -62,16 +62,16 @@ langgraph_api/js/tests/graphs/command.mts,sha256=YO1_cEs_n9VsH_-IediLnI4Yc8KRlp4
|
|
|
62
62
|
langgraph_api/js/tests/graphs/delay.mts,sha256=CFneKxqI4bGGK0lYjSbe80QirowPQlsRSuhDUKfydhk,703
|
|
63
63
|
langgraph_api/js/tests/graphs/dynamic.mts,sha256=Wf_-keF7lkEfp_iyI45nlFGCeU8ARLQ8axc0LXh7TyE,659
|
|
64
64
|
langgraph_api/js/tests/graphs/error.mts,sha256=l4tk89449dj1BnEF_0ZcfPt0Ikk1gl8L1RaSnRfr3xo,487
|
|
65
|
-
langgraph_api/js/tests/graphs/http.mts,sha256=
|
|
65
|
+
langgraph_api/js/tests/graphs/http.mts,sha256=64xbMlLA58323zOX68Zh57zIB5Zl8ZCqEWRPNdJ-oJs,2171
|
|
66
66
|
langgraph_api/js/tests/graphs/langgraph.json,sha256=h6hV1wkNEUIpLBX9JOUKqtIBvbhvzyLEuWtBIHteseg,265
|
|
67
67
|
langgraph_api/js/tests/graphs/nested.mts,sha256=4G7jSOSaFVQAza-_ARbK-Iai1biLlF2DIPDZXf7PLIY,1245
|
|
68
|
-
langgraph_api/js/tests/graphs/package.json,sha256=
|
|
68
|
+
langgraph_api/js/tests/graphs/package.json,sha256=jaLxs1_Qfb4cRNWxZLZOBwS29ftbea-x8LgenXeYFAA,263
|
|
69
69
|
langgraph_api/js/tests/graphs/weather.mts,sha256=A7mLK3xW8h5B-ZyJNAyX2M2fJJwzPJzXs4DYesJwreQ,1655
|
|
70
|
-
langgraph_api/js/tests/graphs/yarn.lock,sha256=
|
|
70
|
+
langgraph_api/js/tests/graphs/yarn.lock,sha256=GwbaZr7inRbWzuuvrQKLHT72zYDKwtengxdb4eYRbI0,11202
|
|
71
71
|
langgraph_api/js/tests/parser.test.mts,sha256=dEC8KTqKygeb1u39ZvpPqCT4HtfPD947nLmITt2buxA,27883
|
|
72
72
|
langgraph_api/js/tests/utils.mts,sha256=q1V9gvT63v95onlfK9W4iv3n9ZJO3h-0RD9TdDYuRyY,439
|
|
73
73
|
langgraph_api/js/ui.py,sha256=XNT8iBcyT8XmbIqSQUWd-j_00HsaWB2vRTVabwFBkik,2439
|
|
74
|
-
langgraph_api/js/yarn.lock,sha256=
|
|
74
|
+
langgraph_api/js/yarn.lock,sha256=XYw61N9krBIAyoABfY1ROXzOCehSHHV9fFQcWBL3OT0,83379
|
|
75
75
|
langgraph_api/logging.py,sha256=JJIzbNIgLCN6ClQ3tA-Mm5ffuBGvpRDSZsEvnIlsuu4,3693
|
|
76
76
|
langgraph_api/metadata.py,sha256=jibmAW9sOQZPZl6ZKOn1u6HrFsmkP0M_OQPChADnyaM,4321
|
|
77
77
|
langgraph_api/middleware/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -99,8 +99,8 @@ langgraph_license/validation.py,sha256=Uu_G8UGO_WTlLsBEY0gTVWjRR4czYGfw5YAD3HLZo
|
|
|
99
99
|
langgraph_runtime/__init__.py,sha256=O4GgSmu33c-Pr8Xzxj_brcK5vkm70iNTcyxEjICFZxA,1075
|
|
100
100
|
logging.json,sha256=3RNjSADZmDq38eHePMm1CbP6qZ71AmpBtLwCmKU9Zgo,379
|
|
101
101
|
openapi.json,sha256=YW4ND-N3adriEoNwxw7UD9endO2xUZoodCtwVIfa2dU,132261
|
|
102
|
-
langgraph_api-0.1.
|
|
103
|
-
langgraph_api-0.1.
|
|
104
|
-
langgraph_api-0.1.
|
|
105
|
-
langgraph_api-0.1.
|
|
106
|
-
langgraph_api-0.1.
|
|
102
|
+
langgraph_api-0.1.9.dist-info/LICENSE,sha256=ZPwVR73Biwm3sK6vR54djCrhaRiM4cAD2zvOQZV8Xis,3859
|
|
103
|
+
langgraph_api-0.1.9.dist-info/METADATA,sha256=qIUDnfoguY_Y4-DY5ycJD33l0L6chFQv5J2sJcqjo3Y,4119
|
|
104
|
+
langgraph_api-0.1.9.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
|
|
105
|
+
langgraph_api-0.1.9.dist-info/entry_points.txt,sha256=3EYLgj89DfzqJHHYGxPH4A_fEtClvlRbWRUHaXO7hj4,77
|
|
106
|
+
langgraph_api-0.1.9.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|