langgraph-api 0.0.19__py3-none-any.whl → 0.0.21__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/auth/custom.py +2 -2
- langgraph_api/cli.py +9 -0
- langgraph_api/config.py +6 -0
- langgraph_api/js/build.mts +5 -4
- langgraph_api/js/client.mts +5 -4
- langgraph_api/js/client.new.mts +5 -4
- langgraph_api/js/package.json +2 -2
- langgraph_api/js/src/graph.mts +6 -0
- langgraph_api/js/src/schema/types.template.mts +3 -1
- langgraph_api/js/tests/graphs/package.json +2 -2
- langgraph_api/js/tests/graphs/yarn.lock +81 -28
- langgraph_api/js/yarn.lock +78 -30
- langgraph_api/metadata.py +11 -2
- langgraph_api/middleware/__init__.py +0 -0
- langgraph_api/middleware/private_network.py +53 -0
- langgraph_api/server.py +22 -7
- {langgraph_api-0.0.19.dist-info → langgraph_api-0.0.21.dist-info}/METADATA +1 -1
- {langgraph_api-0.0.19.dist-info → langgraph_api-0.0.21.dist-info}/RECORD +23 -21
- langgraph_storage/ops.py +2 -1
- /langgraph_api/{http_logger.py → middleware/http_logger.py} +0 -0
- {langgraph_api-0.0.19.dist-info → langgraph_api-0.0.21.dist-info}/LICENSE +0 -0
- {langgraph_api-0.0.19.dist-info → langgraph_api-0.0.21.dist-info}/WHEEL +0 -0
- {langgraph_api-0.0.19.dist-info → langgraph_api-0.0.21.dist-info}/entry_points.txt +0 -0
langgraph_api/auth/custom.py
CHANGED
|
@@ -78,8 +78,8 @@ async def handle_event(
|
|
|
78
78
|
- Raises HTTPException(403) if any handler rejects the request
|
|
79
79
|
|
|
80
80
|
Handlers are run in order from most specific to most general:
|
|
81
|
-
1. Resource+action specific handlers (e.g. "
|
|
82
|
-
2. Resource handlers (e.g. "
|
|
81
|
+
1. Resource+action specific handlers (e.g. "threads", "create")
|
|
82
|
+
2. Resource handlers (e.g. "threads", "*")
|
|
83
83
|
3. Action handlers (e.g. "*", "create")
|
|
84
84
|
4. Global handlers ("*", "*")
|
|
85
85
|
"""
|
langgraph_api/cli.py
CHANGED
|
@@ -150,10 +150,14 @@ def run_server(
|
|
|
150
150
|
**kwargs: Any,
|
|
151
151
|
):
|
|
152
152
|
"""Run the LangGraph API server."""
|
|
153
|
+
|
|
153
154
|
import inspect
|
|
155
|
+
import time
|
|
154
156
|
|
|
155
157
|
import uvicorn
|
|
156
158
|
|
|
159
|
+
start_time = time.time()
|
|
160
|
+
|
|
157
161
|
env_vars = env if isinstance(env, Mapping) else None
|
|
158
162
|
if isinstance(env, str | pathlib.Path):
|
|
159
163
|
try:
|
|
@@ -222,6 +226,9 @@ def run_server(
|
|
|
222
226
|
f"Failed to get organization ID: {str(e)}"
|
|
223
227
|
)
|
|
224
228
|
pass
|
|
229
|
+
thread_logger.info(
|
|
230
|
+
f"Server started in {time.time() - start_time:.2f}s"
|
|
231
|
+
)
|
|
225
232
|
thread_logger.info("🎨 Opening Studio in your browser...")
|
|
226
233
|
thread_logger.info("URL: " + studio_url)
|
|
227
234
|
webbrowser.open(studio_url)
|
|
@@ -256,6 +263,8 @@ For production use, please use LangGraph Cloud.
|
|
|
256
263
|
LANGSERVE_GRAPHS=json.dumps(graphs) if graphs else None,
|
|
257
264
|
LANGSMITH_LANGGRAPH_API_VARIANT="local_dev",
|
|
258
265
|
LANGGRAPH_AUTH=json.dumps(auth) if auth else None,
|
|
266
|
+
# See https://developer.chrome.com/blog/private-network-access-update-2024-03
|
|
267
|
+
ALLOW_PRIVATE_NETWORK="true",
|
|
259
268
|
**(env_vars or {}),
|
|
260
269
|
):
|
|
261
270
|
if open_browser:
|
langgraph_api/config.py
CHANGED
|
@@ -29,8 +29,14 @@ REDIS_URI = env("REDIS_URI", cast=str)
|
|
|
29
29
|
REDIS_MAX_CONNECTIONS = env("REDIS_MAX_CONNECTIONS", cast=int, default=500)
|
|
30
30
|
|
|
31
31
|
# server
|
|
32
|
+
ALLOW_PRIVATE_NETWORK = env("ALLOW_PRIVATE_NETWORK", cast=bool, default=False)
|
|
33
|
+
"""Only enable for langgraph dev when server is running on loopback address.
|
|
34
|
+
|
|
35
|
+
See https://developer.chrome.com/blog/private-network-access-update-2024-03
|
|
36
|
+
"""
|
|
32
37
|
|
|
33
38
|
CORS_ALLOW_ORIGINS = env("CORS_ALLOW_ORIGINS", cast=CommaSeparatedStrings, default="*")
|
|
39
|
+
|
|
34
40
|
CORS_CONFIG = env("CORS_CONFIG", cast=_parse_json, default=None)
|
|
35
41
|
"""
|
|
36
42
|
{
|
langgraph_api/js/build.mts
CHANGED
|
@@ -4,6 +4,7 @@ import { z } from "zod";
|
|
|
4
4
|
import * as fs from "node:fs/promises";
|
|
5
5
|
import * as path from "node:path";
|
|
6
6
|
import {
|
|
7
|
+
filterValidGraphSpecs,
|
|
7
8
|
GraphSchema,
|
|
8
9
|
resolveGraph,
|
|
9
10
|
runGraphSchemaWorker,
|
|
@@ -12,15 +13,15 @@ import {
|
|
|
12
13
|
const __dirname = new URL(".", import.meta.url).pathname;
|
|
13
14
|
|
|
14
15
|
async function main() {
|
|
15
|
-
const specs =
|
|
16
|
-
.record(z.string())
|
|
17
|
-
|
|
16
|
+
const specs = filterValidGraphSpecs(
|
|
17
|
+
z.record(z.string()).parse(JSON.parse(process.env.LANGSERVE_GRAPHS))
|
|
18
|
+
);
|
|
18
19
|
|
|
19
20
|
const GRAPH_SCHEMAS: Record<string, Record<string, GraphSchema>> = {};
|
|
20
21
|
|
|
21
22
|
try {
|
|
22
23
|
await Promise.all(
|
|
23
|
-
|
|
24
|
+
specs.map(async ([graphId, rawSpec]) => {
|
|
24
25
|
console.info(`[${graphId}]: Checking for source file existence`);
|
|
25
26
|
const { resolved, ...spec } = await resolveGraph(rawSpec, {
|
|
26
27
|
onlyFilePresence: true,
|
langgraph_api/js/client.mts
CHANGED
|
@@ -41,6 +41,7 @@ import {
|
|
|
41
41
|
GraphSchema,
|
|
42
42
|
resolveGraph,
|
|
43
43
|
GraphSpec,
|
|
44
|
+
filterValidGraphSpecs,
|
|
44
45
|
} from "./src/graph.mts";
|
|
45
46
|
|
|
46
47
|
const logger = createLogger({
|
|
@@ -725,9 +726,9 @@ async function main() {
|
|
|
725
726
|
const checkpointer = new RemoteCheckpointer();
|
|
726
727
|
const store = new RemoteStore();
|
|
727
728
|
|
|
728
|
-
const specs =
|
|
729
|
-
.record(z.string())
|
|
730
|
-
|
|
729
|
+
const specs = filterValidGraphSpecs(
|
|
730
|
+
z.record(z.string()).parse(JSON.parse(process.env.LANGSERVE_GRAPHS ?? "{}"))
|
|
731
|
+
);
|
|
731
732
|
|
|
732
733
|
if (!process.argv.includes("--skip-schema-cache")) {
|
|
733
734
|
try {
|
|
@@ -742,7 +743,7 @@ async function main() {
|
|
|
742
743
|
}
|
|
743
744
|
|
|
744
745
|
await Promise.all(
|
|
745
|
-
|
|
746
|
+
specs.map(async ([graphId, rawSpec]) => {
|
|
746
747
|
logger.info(`Resolving graph ${graphId}`);
|
|
747
748
|
const { resolved, ...spec } = await resolveGraph(rawSpec);
|
|
748
749
|
|
langgraph_api/js/client.new.mts
CHANGED
|
@@ -37,6 +37,7 @@ import {
|
|
|
37
37
|
GraphSchema,
|
|
38
38
|
resolveGraph,
|
|
39
39
|
GraphSpec,
|
|
40
|
+
filterValidGraphSpecs,
|
|
40
41
|
} from "./src/graph.mts";
|
|
41
42
|
|
|
42
43
|
const logger = createLogger({
|
|
@@ -784,9 +785,9 @@ async function main() {
|
|
|
784
785
|
const checkpointer = new RemoteCheckpointer();
|
|
785
786
|
const store = new RemoteStore();
|
|
786
787
|
|
|
787
|
-
const specs =
|
|
788
|
-
.record(z.string())
|
|
789
|
-
|
|
788
|
+
const specs = filterValidGraphSpecs(
|
|
789
|
+
z.record(z.string()).parse(JSON.parse(process.env.LANGSERVE_GRAPHS ?? "{}"))
|
|
790
|
+
);
|
|
790
791
|
|
|
791
792
|
if (!process.argv.includes("--skip-schema-cache")) {
|
|
792
793
|
try {
|
|
@@ -801,7 +802,7 @@ async function main() {
|
|
|
801
802
|
}
|
|
802
803
|
|
|
803
804
|
await Promise.all(
|
|
804
|
-
|
|
805
|
+
specs.map(async ([graphId, rawSpec]) => {
|
|
805
806
|
logger.info(`Resolving graph ${graphId}`);
|
|
806
807
|
const { resolved, ...spec } = await resolveGraph(rawSpec);
|
|
807
808
|
|
langgraph_api/js/package.json
CHANGED
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"@hono/node-server": "^1.12.0",
|
|
11
11
|
"@hono/zod-validator": "^0.2.2",
|
|
12
|
-
"@langchain/core": "^0.3.
|
|
13
|
-
"@langchain/langgraph": "^0.2.
|
|
12
|
+
"@langchain/core": "^0.3.36",
|
|
13
|
+
"@langchain/langgraph": "^0.2.43",
|
|
14
14
|
"@types/json-schema": "^7.0.15",
|
|
15
15
|
"@typescript/vfs": "^1.6.0",
|
|
16
16
|
"dedent": "^1.5.3",
|
langgraph_api/js/src/graph.mts
CHANGED
|
@@ -20,6 +20,12 @@ export interface GraphSpec {
|
|
|
20
20
|
exportSymbol: string;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
+
export function filterValidGraphSpecs(specs: Record<string, string>) {
|
|
24
|
+
return Object.entries(specs).filter(
|
|
25
|
+
([_, spec]) => !spec.split(":")[0].endsWith(".py")
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
|
|
23
29
|
export async function resolveGraph(
|
|
24
30
|
spec: string,
|
|
25
31
|
options?: { onlyFilePresence?: false }
|
|
@@ -37,7 +37,9 @@ type Inspect<T> = T extends unknown
|
|
|
37
37
|
|
|
38
38
|
type ReflectCompiled<T> = T extends { RunInput: infer S; RunOutput: infer U }
|
|
39
39
|
? { state: S; update: U }
|
|
40
|
-
:
|
|
40
|
+
: T extends { "~InputType": infer InputType; "~OutputType": infer OutputType }
|
|
41
|
+
? { state: OutputType; update: InputType }
|
|
42
|
+
: never;
|
|
41
43
|
|
|
42
44
|
type Reflect<T> =
|
|
43
45
|
Defactorify<T> extends infer DT
|
|
@@ -2,16 +2,22 @@
|
|
|
2
2
|
# yarn lockfile v1
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
"@
|
|
6
|
-
version "
|
|
7
|
-
resolved "https://registry.yarnpkg.com/@
|
|
8
|
-
integrity sha512
|
|
5
|
+
"@cfworker/json-schema@^4.0.2":
|
|
6
|
+
version "4.1.0"
|
|
7
|
+
resolved "https://registry.yarnpkg.com/@cfworker/json-schema/-/json-schema-4.1.0.tgz#cc114da98c23b12f4cd4673ce8a076be24e0233c"
|
|
8
|
+
integrity sha512-/vYKi/qMxwNsuIJ9WGWwM2rflY40ZenK3Kh4uR5vB9/Nz12Y7IUN/Xf4wDA7vzPfw0VNh3b/jz4+MjcVgARKJg==
|
|
9
|
+
|
|
10
|
+
"@langchain/core@^0.3.37":
|
|
11
|
+
version "0.3.37"
|
|
12
|
+
resolved "https://registry.yarnpkg.com/@langchain/core/-/core-0.3.37.tgz#9ea7985c6cdaa075b02241ba3e6ba76c47454daf"
|
|
13
|
+
integrity sha512-LFk9GqHxcyCFx0oXvCBP7vDZIOUHYzzNU7JR+2ofIMnfkBLzcCKzBLySQDfPtd13PrpGHkaeOeLq8H1Tqi9lSw==
|
|
9
14
|
dependencies:
|
|
15
|
+
"@cfworker/json-schema" "^4.0.2"
|
|
10
16
|
ansi-styles "^5.0.0"
|
|
11
17
|
camelcase "6"
|
|
12
18
|
decamelize "1.2.0"
|
|
13
19
|
js-tiktoken "^1.0.12"
|
|
14
|
-
langsmith "
|
|
20
|
+
langsmith ">=0.2.8 <0.4.0"
|
|
15
21
|
mustache "^4.2.0"
|
|
16
22
|
p-queue "^6.6.2"
|
|
17
23
|
p-retry "4"
|
|
@@ -19,30 +25,30 @@
|
|
|
19
25
|
zod "^3.22.4"
|
|
20
26
|
zod-to-json-schema "^3.22.3"
|
|
21
27
|
|
|
22
|
-
"@langchain/langgraph-checkpoint@~0.0.
|
|
23
|
-
version "0.0.
|
|
24
|
-
resolved "https://registry.yarnpkg.com/@langchain/langgraph-checkpoint/-/langgraph-checkpoint-0.0.
|
|
25
|
-
integrity sha512-
|
|
28
|
+
"@langchain/langgraph-checkpoint@~0.0.14":
|
|
29
|
+
version "0.0.14"
|
|
30
|
+
resolved "https://registry.yarnpkg.com/@langchain/langgraph-checkpoint/-/langgraph-checkpoint-0.0.14.tgz#7f66454438a906283d7f4e6179784f312a5a9cbe"
|
|
31
|
+
integrity sha512-UoJc1IZqtnn+AiRhygo1yjNZiXTwdOY6NSb7yrXrN96CAW3LPu8cFe7VihKg5OBv9qaGz1GCvnrNdNAB48HuKQ==
|
|
26
32
|
dependencies:
|
|
27
33
|
uuid "^10.0.0"
|
|
28
34
|
|
|
29
|
-
"@langchain/langgraph-sdk@~0.0.
|
|
30
|
-
version "0.0.
|
|
31
|
-
resolved "https://registry.yarnpkg.com/@langchain/langgraph-sdk/-/langgraph-sdk-0.0.
|
|
32
|
-
integrity sha512-
|
|
35
|
+
"@langchain/langgraph-sdk@~0.0.32":
|
|
36
|
+
version "0.0.36"
|
|
37
|
+
resolved "https://registry.yarnpkg.com/@langchain/langgraph-sdk/-/langgraph-sdk-0.0.36.tgz#b375884552ae3f1c7bf68a0248104786754d04cd"
|
|
38
|
+
integrity sha512-KkAZM0uXBaMcD/dpGTBppOhbvNX6gz+Y1zFAC898OblegFkSvICrkd0oRQ5Ro/GWK/NAoDymnMUDXeZDdUkSuw==
|
|
33
39
|
dependencies:
|
|
34
40
|
"@types/json-schema" "^7.0.15"
|
|
35
41
|
p-queue "^6.6.2"
|
|
36
42
|
p-retry "4"
|
|
37
43
|
uuid "^9.0.0"
|
|
38
44
|
|
|
39
|
-
"@langchain/langgraph@^0.2.
|
|
40
|
-
version "0.2.
|
|
41
|
-
resolved "https://registry.yarnpkg.com/@langchain/langgraph/-/langgraph-0.2.
|
|
42
|
-
integrity sha512
|
|
45
|
+
"@langchain/langgraph@^0.2.43":
|
|
46
|
+
version "0.2.43"
|
|
47
|
+
resolved "https://registry.yarnpkg.com/@langchain/langgraph/-/langgraph-0.2.43.tgz#bf24f8b26bc606cd3be7230364314a227382eb1e"
|
|
48
|
+
integrity sha512-uhdbzm3psUIEqxQUQPXeafLC5dxTzALrVGRnnGZi9gt0qlDueRfopZoh7uWJy+Zol+yN/E2mM3M6ZztSsfUEuQ==
|
|
43
49
|
dependencies:
|
|
44
|
-
"@langchain/langgraph-checkpoint" "~0.0.
|
|
45
|
-
"@langchain/langgraph-sdk" "~0.0.
|
|
50
|
+
"@langchain/langgraph-checkpoint" "~0.0.14"
|
|
51
|
+
"@langchain/langgraph-sdk" "~0.0.32"
|
|
46
52
|
uuid "^10.0.0"
|
|
47
53
|
zod "^3.23.8"
|
|
48
54
|
|
|
@@ -61,6 +67,13 @@
|
|
|
61
67
|
resolved "https://registry.yarnpkg.com/@types/uuid/-/uuid-10.0.0.tgz#e9c07fe50da0f53dc24970cca94d619ff03f6f6d"
|
|
62
68
|
integrity sha512-7gqG38EyHgyP1S+7+xomFtL+ZNHcKv6DwNaCZmJmo1vgMugyF3TCnXVg4t1uk89mLNwnLtnY3TpOpCOyp1/xHQ==
|
|
63
69
|
|
|
70
|
+
ansi-styles@^4.1.0:
|
|
71
|
+
version "4.3.0"
|
|
72
|
+
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937"
|
|
73
|
+
integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==
|
|
74
|
+
dependencies:
|
|
75
|
+
color-convert "^2.0.1"
|
|
76
|
+
|
|
64
77
|
ansi-styles@^5.0.0:
|
|
65
78
|
version "5.2.0"
|
|
66
79
|
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-5.2.0.tgz#07449690ad45777d1924ac2abb2fc8895dba836b"
|
|
@@ -76,10 +89,32 @@ camelcase@6:
|
|
|
76
89
|
resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a"
|
|
77
90
|
integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==
|
|
78
91
|
|
|
79
|
-
|
|
80
|
-
version "
|
|
81
|
-
resolved "https://registry.yarnpkg.com/
|
|
82
|
-
integrity sha512-
|
|
92
|
+
chalk@^4.1.2:
|
|
93
|
+
version "4.1.2"
|
|
94
|
+
resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01"
|
|
95
|
+
integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==
|
|
96
|
+
dependencies:
|
|
97
|
+
ansi-styles "^4.1.0"
|
|
98
|
+
supports-color "^7.1.0"
|
|
99
|
+
|
|
100
|
+
color-convert@^2.0.1:
|
|
101
|
+
version "2.0.1"
|
|
102
|
+
resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3"
|
|
103
|
+
integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==
|
|
104
|
+
dependencies:
|
|
105
|
+
color-name "~1.1.4"
|
|
106
|
+
|
|
107
|
+
color-name@~1.1.4:
|
|
108
|
+
version "1.1.4"
|
|
109
|
+
resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2"
|
|
110
|
+
integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==
|
|
111
|
+
|
|
112
|
+
console-table-printer@^2.12.1:
|
|
113
|
+
version "2.12.1"
|
|
114
|
+
resolved "https://registry.yarnpkg.com/console-table-printer/-/console-table-printer-2.12.1.tgz#4a9646537a246a6d8de57075d4fae1e08abae267"
|
|
115
|
+
integrity sha512-wKGOQRRvdnd89pCeH96e2Fn4wkbenSP6LMHfjfyNLMbGuHEFbMqQNuxXqd0oXG9caIOQ1FTvc5Uijp9/4jujnQ==
|
|
116
|
+
dependencies:
|
|
117
|
+
simple-wcswidth "^1.0.1"
|
|
83
118
|
|
|
84
119
|
decamelize@1.2.0:
|
|
85
120
|
version "1.2.0"
|
|
@@ -91,6 +126,11 @@ eventemitter3@^4.0.4:
|
|
|
91
126
|
resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.7.tgz#2de9b68f6528d5644ef5c59526a1b4a07306169f"
|
|
92
127
|
integrity sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==
|
|
93
128
|
|
|
129
|
+
has-flag@^4.0.0:
|
|
130
|
+
version "4.0.0"
|
|
131
|
+
resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b"
|
|
132
|
+
integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==
|
|
133
|
+
|
|
94
134
|
js-tiktoken@^1.0.12:
|
|
95
135
|
version "1.0.12"
|
|
96
136
|
resolved "https://registry.yarnpkg.com/js-tiktoken/-/js-tiktoken-1.0.12.tgz#af0f5cf58e5e7318240d050c8413234019424211"
|
|
@@ -98,13 +138,14 @@ js-tiktoken@^1.0.12:
|
|
|
98
138
|
dependencies:
|
|
99
139
|
base64-js "^1.5.1"
|
|
100
140
|
|
|
101
|
-
langsmith
|
|
102
|
-
version "0.
|
|
103
|
-
resolved "https://registry.yarnpkg.com/langsmith/-/langsmith-0.
|
|
104
|
-
integrity sha512-
|
|
141
|
+
"langsmith@>=0.2.8 <0.4.0":
|
|
142
|
+
version "0.3.3"
|
|
143
|
+
resolved "https://registry.yarnpkg.com/langsmith/-/langsmith-0.3.3.tgz#fcb61454842cf2f85c937f536fa0729544c7c467"
|
|
144
|
+
integrity sha512-B9B0ThaPYwNdTg9ck6bWF2Mjd1TJvVKLfLedufIudmO8aPDslcc2uVlyPEtskZFEdmfjfVHEqDnhnuAhyifrZQ==
|
|
105
145
|
dependencies:
|
|
106
146
|
"@types/uuid" "^10.0.0"
|
|
107
|
-
|
|
147
|
+
chalk "^4.1.2"
|
|
148
|
+
console-table-printer "^2.12.1"
|
|
108
149
|
p-queue "^6.6.2"
|
|
109
150
|
p-retry "4"
|
|
110
151
|
semver "^7.6.3"
|
|
@@ -153,6 +194,18 @@ semver@^7.6.3:
|
|
|
153
194
|
resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.3.tgz#980f7b5550bc175fb4dc09403085627f9eb33143"
|
|
154
195
|
integrity sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==
|
|
155
196
|
|
|
197
|
+
simple-wcswidth@^1.0.1:
|
|
198
|
+
version "1.0.1"
|
|
199
|
+
resolved "https://registry.yarnpkg.com/simple-wcswidth/-/simple-wcswidth-1.0.1.tgz#8ab18ac0ae342f9d9b629604e54d2aa1ecb018b2"
|
|
200
|
+
integrity sha512-xMO/8eNREtaROt7tJvWJqHBDTMFN4eiQ5I4JRMuilwfnFcV5W9u7RUkueNkdw0jPqGMX36iCywelS5yilTuOxg==
|
|
201
|
+
|
|
202
|
+
supports-color@^7.1.0:
|
|
203
|
+
version "7.2.0"
|
|
204
|
+
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da"
|
|
205
|
+
integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==
|
|
206
|
+
dependencies:
|
|
207
|
+
has-flag "^4.0.0"
|
|
208
|
+
|
|
156
209
|
uuid@^10.0.0:
|
|
157
210
|
version "10.0.0"
|
|
158
211
|
resolved "https://registry.yarnpkg.com/uuid/-/uuid-10.0.0.tgz#5a95aa454e6e002725c79055fd42aaba30ca6294"
|
langgraph_api/js/yarn.lock
CHANGED
|
@@ -30,6 +30,11 @@
|
|
|
30
30
|
"@jridgewell/gen-mapping" "^0.3.5"
|
|
31
31
|
"@jridgewell/trace-mapping" "^0.3.24"
|
|
32
32
|
|
|
33
|
+
"@cfworker/json-schema@^4.0.2":
|
|
34
|
+
version "4.1.0"
|
|
35
|
+
resolved "https://registry.yarnpkg.com/@cfworker/json-schema/-/json-schema-4.1.0.tgz#cc114da98c23b12f4cd4673ce8a076be24e0233c"
|
|
36
|
+
integrity sha512-/vYKi/qMxwNsuIJ9WGWwM2rflY40ZenK3Kh4uR5vB9/Nz12Y7IUN/Xf4wDA7vzPfw0VNh3b/jz4+MjcVgARKJg==
|
|
37
|
+
|
|
33
38
|
"@colors/colors@1.6.0", "@colors/colors@^1.6.0":
|
|
34
39
|
version "1.6.0"
|
|
35
40
|
resolved "https://registry.yarnpkg.com/@colors/colors/-/colors-1.6.0.tgz#ec6cd237440700bc23ca23087f513c75508958b0"
|
|
@@ -345,16 +350,17 @@
|
|
|
345
350
|
"@jridgewell/resolve-uri" "^3.1.0"
|
|
346
351
|
"@jridgewell/sourcemap-codec" "^1.4.14"
|
|
347
352
|
|
|
348
|
-
"@langchain/core@^0.3.
|
|
349
|
-
version "0.3.
|
|
350
|
-
resolved "https://registry.yarnpkg.com/@langchain/core/-/core-0.3.
|
|
351
|
-
integrity sha512-
|
|
353
|
+
"@langchain/core@^0.3.36":
|
|
354
|
+
version "0.3.36"
|
|
355
|
+
resolved "https://registry.yarnpkg.com/@langchain/core/-/core-0.3.36.tgz#00824a3b32e8eaf8f2d8fc8f0d97d513d2771e45"
|
|
356
|
+
integrity sha512-lOS6f5o2MarjGPomHPhzde9xI3lZW2NIOEdCv0dvjb1ZChWhwXWHtAMHSZmuSB53ySzDWAMkimimHd+Yqz5MwQ==
|
|
352
357
|
dependencies:
|
|
358
|
+
"@cfworker/json-schema" "^4.0.2"
|
|
353
359
|
ansi-styles "^5.0.0"
|
|
354
360
|
camelcase "6"
|
|
355
361
|
decamelize "1.2.0"
|
|
356
362
|
js-tiktoken "^1.0.12"
|
|
357
|
-
langsmith "
|
|
363
|
+
langsmith ">=0.2.8 <0.4.0"
|
|
358
364
|
mustache "^4.2.0"
|
|
359
365
|
p-queue "^6.6.2"
|
|
360
366
|
p-retry "4"
|
|
@@ -362,10 +368,10 @@
|
|
|
362
368
|
zod "^3.22.4"
|
|
363
369
|
zod-to-json-schema "^3.22.3"
|
|
364
370
|
|
|
365
|
-
"@langchain/langgraph-checkpoint@~0.0.
|
|
366
|
-
version "0.0.
|
|
367
|
-
resolved "https://registry.yarnpkg.com/@langchain/langgraph-checkpoint/-/langgraph-checkpoint-0.0.
|
|
368
|
-
integrity sha512-
|
|
371
|
+
"@langchain/langgraph-checkpoint@~0.0.14":
|
|
372
|
+
version "0.0.14"
|
|
373
|
+
resolved "https://registry.yarnpkg.com/@langchain/langgraph-checkpoint/-/langgraph-checkpoint-0.0.14.tgz#7f66454438a906283d7f4e6179784f312a5a9cbe"
|
|
374
|
+
integrity sha512-UoJc1IZqtnn+AiRhygo1yjNZiXTwdOY6NSb7yrXrN96CAW3LPu8cFe7VihKg5OBv9qaGz1GCvnrNdNAB48HuKQ==
|
|
369
375
|
dependencies:
|
|
370
376
|
uuid "^10.0.0"
|
|
371
377
|
|
|
@@ -379,23 +385,23 @@
|
|
|
379
385
|
p-retry "4"
|
|
380
386
|
uuid "^9.0.0"
|
|
381
387
|
|
|
382
|
-
"@langchain/langgraph-sdk@~0.0.
|
|
383
|
-
version "0.0.
|
|
384
|
-
resolved "https://registry.yarnpkg.com/@langchain/langgraph-sdk/-/langgraph-sdk-0.0.
|
|
385
|
-
integrity sha512-
|
|
388
|
+
"@langchain/langgraph-sdk@~0.0.32":
|
|
389
|
+
version "0.0.36"
|
|
390
|
+
resolved "https://registry.yarnpkg.com/@langchain/langgraph-sdk/-/langgraph-sdk-0.0.36.tgz#b375884552ae3f1c7bf68a0248104786754d04cd"
|
|
391
|
+
integrity sha512-KkAZM0uXBaMcD/dpGTBppOhbvNX6gz+Y1zFAC898OblegFkSvICrkd0oRQ5Ro/GWK/NAoDymnMUDXeZDdUkSuw==
|
|
386
392
|
dependencies:
|
|
387
393
|
"@types/json-schema" "^7.0.15"
|
|
388
394
|
p-queue "^6.6.2"
|
|
389
395
|
p-retry "4"
|
|
390
396
|
uuid "^9.0.0"
|
|
391
397
|
|
|
392
|
-
"@langchain/langgraph@^0.2.
|
|
393
|
-
version "0.2.
|
|
394
|
-
resolved "https://registry.yarnpkg.com/@langchain/langgraph/-/langgraph-0.2.
|
|
395
|
-
integrity sha512-
|
|
398
|
+
"@langchain/langgraph@^0.2.43":
|
|
399
|
+
version "0.2.43"
|
|
400
|
+
resolved "https://registry.yarnpkg.com/@langchain/langgraph/-/langgraph-0.2.43.tgz#bf24f8b26bc606cd3be7230364314a227382eb1e"
|
|
401
|
+
integrity sha512-uhdbzm3psUIEqxQUQPXeafLC5dxTzALrVGRnnGZi9gt0qlDueRfopZoh7uWJy+Zol+yN/E2mM3M6ZztSsfUEuQ==
|
|
396
402
|
dependencies:
|
|
397
|
-
"@langchain/langgraph-checkpoint" "~0.0.
|
|
398
|
-
"@langchain/langgraph-sdk" "~0.0.
|
|
403
|
+
"@langchain/langgraph-checkpoint" "~0.0.14"
|
|
404
|
+
"@langchain/langgraph-sdk" "~0.0.32"
|
|
399
405
|
uuid "^10.0.0"
|
|
400
406
|
zod "^3.23.8"
|
|
401
407
|
|
|
@@ -607,6 +613,13 @@ ansi-regex@^5.0.1:
|
|
|
607
613
|
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304"
|
|
608
614
|
integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==
|
|
609
615
|
|
|
616
|
+
ansi-styles@^4.1.0:
|
|
617
|
+
version "4.3.0"
|
|
618
|
+
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937"
|
|
619
|
+
integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==
|
|
620
|
+
dependencies:
|
|
621
|
+
color-convert "^2.0.1"
|
|
622
|
+
|
|
610
623
|
ansi-styles@^5.0.0:
|
|
611
624
|
version "5.2.0"
|
|
612
625
|
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-5.2.0.tgz#07449690ad45777d1924ac2abb2fc8895dba836b"
|
|
@@ -731,6 +744,14 @@ chai@^5.1.1:
|
|
|
731
744
|
loupe "^3.1.0"
|
|
732
745
|
pathval "^2.0.0"
|
|
733
746
|
|
|
747
|
+
chalk@^4.1.2:
|
|
748
|
+
version "4.1.2"
|
|
749
|
+
resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01"
|
|
750
|
+
integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==
|
|
751
|
+
dependencies:
|
|
752
|
+
ansi-styles "^4.1.0"
|
|
753
|
+
supports-color "^7.1.0"
|
|
754
|
+
|
|
734
755
|
check-error@^2.1.1:
|
|
735
756
|
version "2.1.1"
|
|
736
757
|
resolved "https://registry.yarnpkg.com/check-error/-/check-error-2.1.1.tgz#87eb876ae71ee388fa0471fe423f494be1d96ccc"
|
|
@@ -748,12 +769,19 @@ color-convert@^1.9.3:
|
|
|
748
769
|
dependencies:
|
|
749
770
|
color-name "1.1.3"
|
|
750
771
|
|
|
772
|
+
color-convert@^2.0.1:
|
|
773
|
+
version "2.0.1"
|
|
774
|
+
resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3"
|
|
775
|
+
integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==
|
|
776
|
+
dependencies:
|
|
777
|
+
color-name "~1.1.4"
|
|
778
|
+
|
|
751
779
|
color-name@1.1.3:
|
|
752
780
|
version "1.1.3"
|
|
753
781
|
resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25"
|
|
754
782
|
integrity sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==
|
|
755
783
|
|
|
756
|
-
color-name@^1.0.0:
|
|
784
|
+
color-name@^1.0.0, color-name@~1.1.4:
|
|
757
785
|
version "1.1.4"
|
|
758
786
|
resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2"
|
|
759
787
|
integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==
|
|
@@ -794,16 +822,18 @@ combined-stream@^1.0.8, combined-stream@~1.0.6:
|
|
|
794
822
|
dependencies:
|
|
795
823
|
delayed-stream "~1.0.0"
|
|
796
824
|
|
|
797
|
-
commander@^10.0.1:
|
|
798
|
-
version "10.0.1"
|
|
799
|
-
resolved "https://registry.yarnpkg.com/commander/-/commander-10.0.1.tgz#881ee46b4f77d1c1dccc5823433aa39b022cbe06"
|
|
800
|
-
integrity sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==
|
|
801
|
-
|
|
802
825
|
console-control-strings@^1.1.0:
|
|
803
826
|
version "1.1.0"
|
|
804
827
|
resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e"
|
|
805
828
|
integrity sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==
|
|
806
829
|
|
|
830
|
+
console-table-printer@^2.12.1:
|
|
831
|
+
version "2.12.1"
|
|
832
|
+
resolved "https://registry.yarnpkg.com/console-table-printer/-/console-table-printer-2.12.1.tgz#4a9646537a246a6d8de57075d4fae1e08abae267"
|
|
833
|
+
integrity sha512-wKGOQRRvdnd89pCeH96e2Fn4wkbenSP6LMHfjfyNLMbGuHEFbMqQNuxXqd0oXG9caIOQ1FTvc5Uijp9/4jujnQ==
|
|
834
|
+
dependencies:
|
|
835
|
+
simple-wcswidth "^1.0.1"
|
|
836
|
+
|
|
807
837
|
core-util-is@1.0.2:
|
|
808
838
|
version "1.0.2"
|
|
809
839
|
resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
|
|
@@ -1183,6 +1213,11 @@ graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.2:
|
|
|
1183
1213
|
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3"
|
|
1184
1214
|
integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==
|
|
1185
1215
|
|
|
1216
|
+
has-flag@^4.0.0:
|
|
1217
|
+
version "4.0.0"
|
|
1218
|
+
resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b"
|
|
1219
|
+
integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==
|
|
1220
|
+
|
|
1186
1221
|
has-property-descriptors@^1.0.2:
|
|
1187
1222
|
version "1.0.2"
|
|
1188
1223
|
resolved "https://registry.yarnpkg.com/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz#963ed7d071dc7bf5f084c5bfbe0d1b6222586854"
|
|
@@ -1356,13 +1391,14 @@ kuler@^2.0.0:
|
|
|
1356
1391
|
resolved "https://registry.yarnpkg.com/kuler/-/kuler-2.0.0.tgz#e2c570a3800388fb44407e851531c1d670b061b3"
|
|
1357
1392
|
integrity sha512-Xq9nH7KlWZmXAtodXDDRE7vs6DU1gTU8zYDHDiWLSip45Egwq3plLHzPn27NgvzL2r1LMPC1vdqh98sQxtqj4A==
|
|
1358
1393
|
|
|
1359
|
-
langsmith
|
|
1360
|
-
version "0.
|
|
1361
|
-
resolved "https://registry.yarnpkg.com/langsmith/-/langsmith-0.
|
|
1362
|
-
integrity sha512-
|
|
1394
|
+
"langsmith@>=0.2.8 <0.4.0":
|
|
1395
|
+
version "0.3.3"
|
|
1396
|
+
resolved "https://registry.yarnpkg.com/langsmith/-/langsmith-0.3.3.tgz#fcb61454842cf2f85c937f536fa0729544c7c467"
|
|
1397
|
+
integrity sha512-B9B0ThaPYwNdTg9ck6bWF2Mjd1TJvVKLfLedufIudmO8aPDslcc2uVlyPEtskZFEdmfjfVHEqDnhnuAhyifrZQ==
|
|
1363
1398
|
dependencies:
|
|
1364
1399
|
"@types/uuid" "^10.0.0"
|
|
1365
|
-
|
|
1400
|
+
chalk "^4.1.2"
|
|
1401
|
+
console-table-printer "^2.12.1"
|
|
1366
1402
|
p-queue "^6.6.2"
|
|
1367
1403
|
p-retry "4"
|
|
1368
1404
|
semver "^7.6.3"
|
|
@@ -1838,6 +1874,11 @@ simple-swizzle@^0.2.2:
|
|
|
1838
1874
|
dependencies:
|
|
1839
1875
|
is-arrayish "^0.3.1"
|
|
1840
1876
|
|
|
1877
|
+
simple-wcswidth@^1.0.1:
|
|
1878
|
+
version "1.0.1"
|
|
1879
|
+
resolved "https://registry.yarnpkg.com/simple-wcswidth/-/simple-wcswidth-1.0.1.tgz#8ab18ac0ae342f9d9b629604e54d2aa1ecb018b2"
|
|
1880
|
+
integrity sha512-xMO/8eNREtaROt7tJvWJqHBDTMFN4eiQ5I4JRMuilwfnFcV5W9u7RUkueNkdw0jPqGMX36iCywelS5yilTuOxg==
|
|
1881
|
+
|
|
1841
1882
|
source-map-js@^1.2.0:
|
|
1842
1883
|
version "1.2.0"
|
|
1843
1884
|
resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.2.0.tgz#16b809c162517b5b8c3e7dcd315a2a5c2612b2af"
|
|
@@ -1913,6 +1954,13 @@ strip-final-newline@^3.0.0:
|
|
|
1913
1954
|
resolved "https://registry.yarnpkg.com/strip-final-newline/-/strip-final-newline-3.0.0.tgz#52894c313fbff318835280aed60ff71ebf12b8fd"
|
|
1914
1955
|
integrity sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==
|
|
1915
1956
|
|
|
1957
|
+
supports-color@^7.1.0:
|
|
1958
|
+
version "7.2.0"
|
|
1959
|
+
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da"
|
|
1960
|
+
integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==
|
|
1961
|
+
dependencies:
|
|
1962
|
+
has-flag "^4.0.0"
|
|
1963
|
+
|
|
1916
1964
|
supports-preserve-symlinks-flag@^1.0.0:
|
|
1917
1965
|
version "1.0.0"
|
|
1918
1966
|
resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09"
|
langgraph_api/metadata.py
CHANGED
|
@@ -6,7 +6,11 @@ import langgraph.version
|
|
|
6
6
|
import orjson
|
|
7
7
|
import structlog
|
|
8
8
|
|
|
9
|
-
from langgraph_api.config import
|
|
9
|
+
from langgraph_api.config import (
|
|
10
|
+
LANGGRAPH_CLOUD_LICENSE_KEY,
|
|
11
|
+
LANGSMITH_API_KEY,
|
|
12
|
+
LANGSMITH_AUTH_ENDPOINT,
|
|
13
|
+
)
|
|
10
14
|
from langgraph_api.http import http_request
|
|
11
15
|
from langgraph_license.validation import plus_features_enabled
|
|
12
16
|
|
|
@@ -28,6 +32,11 @@ RUN_COUNTER = 0
|
|
|
28
32
|
NODE_COUNTER = 0
|
|
29
33
|
FROM_TIMESTAMP = datetime.now(UTC).isoformat()
|
|
30
34
|
|
|
35
|
+
if "api.smith.langchain.com" in LANGSMITH_AUTH_ENDPOINT:
|
|
36
|
+
METADATA_ENDPOINT = LANGSMITH_AUTH_ENDPOINT.rstrip("/") + "/v1/metadata/submit"
|
|
37
|
+
else:
|
|
38
|
+
METADATA_ENDPOINT = "https://api.smith.langchain.com/v1/metadata/submit"
|
|
39
|
+
|
|
31
40
|
|
|
32
41
|
def incr_runs(*, incr: int = 1) -> None:
|
|
33
42
|
global RUN_COUNTER
|
|
@@ -88,7 +97,7 @@ async def metadata_loop() -> None:
|
|
|
88
97
|
try:
|
|
89
98
|
await http_request(
|
|
90
99
|
"POST",
|
|
91
|
-
|
|
100
|
+
METADATA_ENDPOINT,
|
|
92
101
|
body=orjson.dumps(payload),
|
|
93
102
|
headers={"Content-Type": "application/json"},
|
|
94
103
|
)
|
|
File without changes
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"""Middleware to handle private network requests for CORS preflight."""
|
|
2
|
+
|
|
3
|
+
from typing import Any
|
|
4
|
+
|
|
5
|
+
from starlette.middleware.base import BaseHTTPMiddleware
|
|
6
|
+
from starlette.requests import Request
|
|
7
|
+
from starlette.responses import Response
|
|
8
|
+
from starlette.types import ASGIApp
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class PrivateNetworkMiddleware(BaseHTTPMiddleware):
|
|
12
|
+
"""Add Access-Control-Allow-Private-Network header for preflight requests.
|
|
13
|
+
|
|
14
|
+
This middleware intercepts OPTIONS requests and adds the
|
|
15
|
+
Access-Control-Allow-Private-Network header to the response, allowing private
|
|
16
|
+
network access for CORS preflight requests.
|
|
17
|
+
|
|
18
|
+
For context see:
|
|
19
|
+
* https://github.com/langchain-ai/langgraph/issues/3261
|
|
20
|
+
* https://developer.chrome.com/blog/private-network-access-update-2024-03
|
|
21
|
+
|
|
22
|
+
We should only automatically turn it on for the loopback address, when users
|
|
23
|
+
use `langgraph dev`.
|
|
24
|
+
|
|
25
|
+
A web browser determines whether a network is private based on IP address ranges
|
|
26
|
+
and local networking conditions. Typically, it checks:
|
|
27
|
+
|
|
28
|
+
IP Address Range – If the website is hosted on an IP within private address
|
|
29
|
+
ranges (RFC 1918):
|
|
30
|
+
|
|
31
|
+
10.0.0.0 – 10.255.255.255
|
|
32
|
+
172.16.0.0 – 172.31.255.255
|
|
33
|
+
192.168.0.0 – 192.168.255.255
|
|
34
|
+
127.0.0.1 (loopback)
|
|
35
|
+
Localhost and Hostname – Domains like localhost or .local are assumed to be private.
|
|
36
|
+
|
|
37
|
+
Network Context – The browser may check if the device is connected
|
|
38
|
+
to a local network (e.g., corporate or home Wi-Fi) rather than the public internet.
|
|
39
|
+
|
|
40
|
+
CORS and Private Network Access (PNA) – Modern browsers implement restrictions
|
|
41
|
+
where resources on private networks require explicit permission (via CORS headers)
|
|
42
|
+
when accessed from a public site.
|
|
43
|
+
"""
|
|
44
|
+
|
|
45
|
+
def __init__(self, app: ASGIApp):
|
|
46
|
+
"""Initialize middleware."""
|
|
47
|
+
super().__init__(app)
|
|
48
|
+
|
|
49
|
+
async def dispatch(self, request: Request, call_next: Any) -> Response:
|
|
50
|
+
response = await call_next(request)
|
|
51
|
+
if request.method == "OPTIONS": # Handle preflight requests
|
|
52
|
+
response.headers["Access-Control-Allow-Private-Network"] = "true"
|
|
53
|
+
return response
|
langgraph_api/server.py
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
# MONKEY PATCH: Patch Starlette to fix an error in the library
|
|
2
|
+
import langgraph_api.patch # noqa: F401,I001
|
|
3
|
+
|
|
4
|
+
# WARNING: Keep the import above before other code runs as it
|
|
5
|
+
# patches an error in the Starlette library.
|
|
1
6
|
import logging
|
|
2
7
|
|
|
3
8
|
import jsonschema_rs
|
|
@@ -8,25 +13,28 @@ from starlette.middleware import Middleware
|
|
|
8
13
|
from starlette.middleware.cors import CORSMiddleware
|
|
9
14
|
|
|
10
15
|
import langgraph_api.config as config
|
|
11
|
-
import langgraph_api.patch # noqa: F401
|
|
12
16
|
from langgraph_api.api import routes
|
|
13
17
|
from langgraph_api.errors import (
|
|
14
18
|
overloaded_error_handler,
|
|
15
19
|
validation_error_handler,
|
|
16
20
|
value_error_handler,
|
|
17
21
|
)
|
|
18
|
-
from langgraph_api.http_logger import AccessLoggerMiddleware
|
|
19
22
|
from langgraph_api.lifespan import lifespan
|
|
23
|
+
from langgraph_api.middleware.http_logger import AccessLoggerMiddleware
|
|
24
|
+
from langgraph_api.middleware.private_network import PrivateNetworkMiddleware
|
|
20
25
|
from langgraph_license.middleware import LicenseValidationMiddleware
|
|
21
26
|
from langgraph_storage.retry import OVERLOADED_EXCEPTIONS
|
|
22
27
|
|
|
23
28
|
logging.captureWarnings(True)
|
|
24
29
|
logger = structlog.stdlib.get_logger(__name__)
|
|
25
30
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
middleware
|
|
31
|
+
middleware = []
|
|
32
|
+
|
|
33
|
+
if config.ALLOW_PRIVATE_NETWORK:
|
|
34
|
+
middleware.append(Middleware(PrivateNetworkMiddleware))
|
|
35
|
+
|
|
36
|
+
middleware.extend(
|
|
37
|
+
[
|
|
30
38
|
Middleware(
|
|
31
39
|
CORSMiddleware,
|
|
32
40
|
allow_origins=config.CORS_ALLOW_ORIGINS,
|
|
@@ -41,7 +49,14 @@ app = Starlette(
|
|
|
41
49
|
),
|
|
42
50
|
Middleware(LicenseValidationMiddleware),
|
|
43
51
|
Middleware(AccessLoggerMiddleware, logger=logger),
|
|
44
|
-
]
|
|
52
|
+
]
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
app = Starlette(
|
|
57
|
+
routes=routes,
|
|
58
|
+
lifespan=lifespan,
|
|
59
|
+
middleware=middleware,
|
|
45
60
|
exception_handlers={
|
|
46
61
|
ValueError: value_error_handler,
|
|
47
62
|
InvalidUpdateError: value_error_handler,
|
|
@@ -9,39 +9,38 @@ langgraph_api/api/store.py,sha256=VzAJVOwO0IxosBB7km5TTf2rhlWGyPkVz_LpvbxetVY,54
|
|
|
9
9
|
langgraph_api/api/threads.py,sha256=taU61XPcCEhBPCYPZcMDsgVDwwWUWJs8p-PrXFXWY48,8661
|
|
10
10
|
langgraph_api/asyncio.py,sha256=2fOlx-cZvuj1gQ867Kw1R_wsBsl9jdHYHcUtK2a-x-U,6264
|
|
11
11
|
langgraph_api/auth/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
12
|
-
langgraph_api/auth/custom.py,sha256=
|
|
12
|
+
langgraph_api/auth/custom.py,sha256=ZFyR5Yf_n5KJrMxBOy30hA396itQVvU4ywcyPwTE0og,21031
|
|
13
13
|
langgraph_api/auth/langsmith/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
14
14
|
langgraph_api/auth/langsmith/backend.py,sha256=InScaL-HYCnxYEauhxU198gRZV9pJn9SzzBoR9Edn7g,2654
|
|
15
15
|
langgraph_api/auth/langsmith/client.py,sha256=eKchvAom7hdkUXauD8vHNceBDDUijrFgdTV8bKd7x4Q,3998
|
|
16
16
|
langgraph_api/auth/middleware.py,sha256=qc7SbaFoeWaqxS1wbjZ2PPQ4iI2p9T0shWL7c6g0ed4,1636
|
|
17
17
|
langgraph_api/auth/noop.py,sha256=Bk6Nf3p8D_iMVy_OyfPlyiJp_aEwzL-sHrbxoXpCbac,586
|
|
18
18
|
langgraph_api/auth/studio_user.py,sha256=FzFQRROKDlA9JjtBuwyZvk6Mbwno5M9RVYjDO6FU3F8,186
|
|
19
|
-
langgraph_api/cli.py,sha256=
|
|
20
|
-
langgraph_api/config.py,sha256=
|
|
19
|
+
langgraph_api/cli.py,sha256=r7NJVIdTQ9mQ6_X01tk_I0ktlgn9odH0B8J53oaySz4,12022
|
|
20
|
+
langgraph_api/config.py,sha256=vVANO2F7O94XvnXc0krwQrE8o7E-nEJtZQVGLbMoxZc,4272
|
|
21
21
|
langgraph_api/cron_scheduler.py,sha256=MW41-TSGUe5OuXycFTy7Ax7ypxHVAv-0ImLonRT8h8o,2629
|
|
22
22
|
langgraph_api/errors.py,sha256=Bu_i5drgNTyJcLiyrwVE_6-XrSU50BHf9TDpttki9wQ,1690
|
|
23
23
|
langgraph_api/graph.py,sha256=FombjYQkqj8jrXJFEVkl3m2UyFcq5nSVNswR2HoRsQY,16385
|
|
24
24
|
langgraph_api/http.py,sha256=XrbyxpjtfSvnaWWh5ZLGpgZmY83WoDCrP_1GPguNiXI,4712
|
|
25
|
-
langgraph_api/http_logger.py,sha256=Sxo_q-65tElauRvkzVLt9lJojgNdgtcHGBYD0IRyX7M,3146
|
|
26
25
|
langgraph_api/js/.gitignore,sha256=qAah3Fq0HWAlfRj5ktZyC6QRQIsAolGLRGcRukA1XJI,33
|
|
27
26
|
langgraph_api/js/base.py,sha256=BpE8-xkUp8HFPRjSKx1tfUQubvoV4jYl6OwZdre3veI,209
|
|
28
|
-
langgraph_api/js/build.mts,sha256=
|
|
29
|
-
langgraph_api/js/client.mts,sha256=
|
|
30
|
-
langgraph_api/js/client.new.mts,sha256=
|
|
27
|
+
langgraph_api/js/build.mts,sha256=43_LQDjmtEyV6Sj6IZo7Mp6Y8zrsBbMP_5sWXQ_xBsY,1372
|
|
28
|
+
langgraph_api/js/client.mts,sha256=AWDSJHAFFtCKU8JkSg0NEPt85jtovk64SYDesIALtW0,22684
|
|
29
|
+
langgraph_api/js/client.new.mts,sha256=FskIvfdS4MvzoD07fJuHMoz26Puh_Mkwh2Lh6jKFj60,23658
|
|
31
30
|
langgraph_api/js/errors.py,sha256=Cm1TKWlUCwZReDC5AQ6SgNIVGD27Qov2xcgHyf8-GXo,361
|
|
32
31
|
langgraph_api/js/global.d.ts,sha256=zR_zLYfpzyPfxpEFth5RgZoyfGulIXyZYPRf7cU0K0Y,106
|
|
33
|
-
langgraph_api/js/package.json,sha256=
|
|
32
|
+
langgraph_api/js/package.json,sha256=Z7Yluyxl4WbrcagLzBNB2ZL0cihX9dWkUn08vYrLoUw,840
|
|
34
33
|
langgraph_api/js/remote.py,sha256=D9cqcEgXau-fm_trpNwCHMra5BXntgUa469lgs_a9JQ,622
|
|
35
34
|
langgraph_api/js/remote_new.py,sha256=T_Vr8459bax1C9xxqz_ZYmGivq5Vhspg2Iu9TL0Qc-Q,22707
|
|
36
35
|
langgraph_api/js/remote_old.py,sha256=2a-3ooAYUZs8aPsfnXafbBd4pP7lRmokoU7TiO7P9Js,22546
|
|
37
36
|
langgraph_api/js/schema.py,sha256=7idnv7URlYUdSNMBXQcw7E4SxaPxCq_Oxwnlml8q5ik,408
|
|
38
37
|
langgraph_api/js/server_sent_events.py,sha256=DLgXOHauemt7706vnfDUCG1GI3TidKycSizccdz9KgA,3702
|
|
39
|
-
langgraph_api/js/src/graph.mts,sha256=
|
|
38
|
+
langgraph_api/js/src/graph.mts,sha256=J-M-vYHj1G5tyonPUym3ePNGqGYtspPCrZOgr92xKb4,3171
|
|
40
39
|
langgraph_api/js/src/hooks.mjs,sha256=XtktgmIHlls_DsknAuwib-z7TqCm0haRoTXvnkgzMuo,601
|
|
41
40
|
langgraph_api/js/src/parser/parser.mts,sha256=wXre7teh8N8RYmGcyhZp4vMJd0kNnnFgoSGEyMVPzpQ,13007
|
|
42
41
|
langgraph_api/js/src/parser/parser.worker.mjs,sha256=2K6D0GlUmkk7LE39I8mryB8VZVE3-N9Cblji-ArPhFo,386
|
|
43
42
|
langgraph_api/js/src/schema/types.mts,sha256=SUj0vpvWVbID1mnGr2SUtumDBQkJ9zjfvJdoFP7DIzk,66536
|
|
44
|
-
langgraph_api/js/src/schema/types.template.mts,sha256=
|
|
43
|
+
langgraph_api/js/src/schema/types.template.mts,sha256=oAwnwWOgkEAQ3EouB8dG5Mdg4H75-aj5av40Mxfq7Xw,2141
|
|
45
44
|
langgraph_api/js/src/utils/importMap.mts,sha256=pX4TGOyUpuuWF82kXcxcv3-8mgusRezOGe6Uklm2O5A,1644
|
|
46
45
|
langgraph_api/js/src/utils/pythonSchemas.mts,sha256=98IW7Z_VP7L_CHNRMb3_MsiV3BgLE2JsWQY_PQcRR3o,685
|
|
47
46
|
langgraph_api/js/src/utils/serde.mts,sha256=OuyyO9btvwWd55rU_H4x91dFEJiaPxL-lL9O6Zgo908,742
|
|
@@ -53,15 +52,18 @@ langgraph_api/js/tests/graphs/delay.mts,sha256=CFneKxqI4bGGK0lYjSbe80QirowPQlsRS
|
|
|
53
52
|
langgraph_api/js/tests/graphs/error.mts,sha256=l4tk89449dj1BnEF_0ZcfPt0Ikk1gl8L1RaSnRfr3xo,487
|
|
54
53
|
langgraph_api/js/tests/graphs/langgraph.json,sha256=frxd7ZWILdeMYSZgUBH6UO-IR7I2YJSOfOlx2mnO1sI,189
|
|
55
54
|
langgraph_api/js/tests/graphs/nested.mts,sha256=4G7jSOSaFVQAza-_ARbK-Iai1biLlF2DIPDZXf7PLIY,1245
|
|
56
|
-
langgraph_api/js/tests/graphs/package.json,sha256=
|
|
55
|
+
langgraph_api/js/tests/graphs/package.json,sha256=U1e03aGujf7LHM9j_01fwbD7hcC59kxJM4ZvUECVF3o,118
|
|
57
56
|
langgraph_api/js/tests/graphs/weather.mts,sha256=A7mLK3xW8h5B-ZyJNAyX2M2fJJwzPJzXs4DYesJwreQ,1655
|
|
58
|
-
langgraph_api/js/tests/graphs/yarn.lock,sha256=
|
|
57
|
+
langgraph_api/js/tests/graphs/yarn.lock,sha256=N-LBwqNAve0B_VvVZvSAGVkCCo9AQO6VDM-AznGVVLQ,10407
|
|
59
58
|
langgraph_api/js/tests/parser.test.mts,sha256=3zAbboUNhI-cY3hj4Ssr7J-sQXCBTeeI1ItrkG0Ftuk,26257
|
|
60
59
|
langgraph_api/js/tests/utils.mts,sha256=2kTybJ3O7Yfe1q3ehDouqV54ibXkNzsPZ_wBZLJvY-4,421
|
|
61
|
-
langgraph_api/js/yarn.lock,sha256=
|
|
60
|
+
langgraph_api/js/yarn.lock,sha256=slQ8Gr_G-_8tyLgjhE6ABtvVAnv0PTZzei5Eo6Xh-1g,105950
|
|
62
61
|
langgraph_api/lifespan.py,sha256=Uj7NV-NqxxD1fgx_umM9pVqclcy-VlqrIxDljyj2he0,1820
|
|
63
62
|
langgraph_api/logging.py,sha256=tiDNrEFwqaIdL5ywZv908OXlzzfXsPCws9GXeoFtBV8,3367
|
|
64
|
-
langgraph_api/metadata.py,sha256=
|
|
63
|
+
langgraph_api/metadata.py,sha256=wvNCHvejBiO_VaAF12kbdlNDn1QXH4Fh_buvHD9J60U,3276
|
|
64
|
+
langgraph_api/middleware/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
65
|
+
langgraph_api/middleware/http_logger.py,sha256=Sxo_q-65tElauRvkzVLt9lJojgNdgtcHGBYD0IRyX7M,3146
|
|
66
|
+
langgraph_api/middleware/private_network.py,sha256=eYgdyU8AzU2XJu362i1L8aSFoQRiV7_aLBPw7_EgeqI,2111
|
|
65
67
|
langgraph_api/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
66
68
|
langgraph_api/models/run.py,sha256=1TzTmagDXFQD_LhIMRdguZHmrPSzztq1wiMjF63d2fc,9843
|
|
67
69
|
langgraph_api/patch.py,sha256=94ddcTSZJe22JcpjxiSNjFZdYVnmeoWjk4IX4iBSoyk,1249
|
|
@@ -69,7 +71,7 @@ langgraph_api/queue.py,sha256=qRuM09mz8o7CkrBIwg-9lV3SW0TehdVGgeXvHc_adYk,13647
|
|
|
69
71
|
langgraph_api/route.py,sha256=fM4qYCGbmH0a3_cV8uKocb1sLklehxO6HhdRXqLK6OM,4421
|
|
70
72
|
langgraph_api/schema.py,sha256=4aZCFY-dxd_nTot71bdcd9S8QCIgKajuRyj0p2QfgJ4,5291
|
|
71
73
|
langgraph_api/serde.py,sha256=VoJ7Z1IuqrQGXFzEP1qijAITtWCrmjtVqlCRuScjXJI,3533
|
|
72
|
-
langgraph_api/server.py,sha256=
|
|
74
|
+
langgraph_api/server.py,sha256=mKJWBuHN5HFHCQIL_FtH04wyFabR4mR6WmQcioI-_Ns,2071
|
|
73
75
|
langgraph_api/sse.py,sha256=2wNodCOP2eg7a9mpSu0S3FQ0CHk2BBV_vv0UtIgJIcc,4034
|
|
74
76
|
langgraph_api/state.py,sha256=8jx4IoTCOjTJuwzuXJKKFwo1VseHjNnw_CCq4x1SW14,2284
|
|
75
77
|
langgraph_api/stream.py,sha256=MUYYNgwtLs1Mhq1dm12zda7j8uFYir49umigK6CnuXU,11944
|
|
@@ -81,15 +83,15 @@ langgraph_license/validation.py,sha256=Uu_G8UGO_WTlLsBEY0gTVWjRR4czYGfw5YAD3HLZo
|
|
|
81
83
|
langgraph_storage/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
82
84
|
langgraph_storage/checkpoint.py,sha256=V4t2GwYEJdPCHbhq_4Udhlv0TWKDzlMu_rlNPdTDc50,3589
|
|
83
85
|
langgraph_storage/database.py,sha256=Nr5zE9Fur3-tESkqe7xNXMf2QlBuw3H0CUie7jVa6Q4,6003
|
|
84
|
-
langgraph_storage/ops.py,sha256=
|
|
86
|
+
langgraph_storage/ops.py,sha256=Pv829coa6wCYKKdYBR0IZaKMtkgw1g9EmOIayI_GJXg,68242
|
|
85
87
|
langgraph_storage/queue.py,sha256=6cTZ0ubHu3S1T43yxHMVOwsQsDaJupByiU0sTUFFls8,3261
|
|
86
88
|
langgraph_storage/retry.py,sha256=uvYFuXJ-T6S1QY1ZwkZHyZQbsvS-Ab68LSbzbUUSI2E,696
|
|
87
89
|
langgraph_storage/store.py,sha256=D-p3cWc_umamkKp-6Cz3cAriSACpvM5nxUIvND6PuxE,2710
|
|
88
90
|
langgraph_storage/ttl_dict.py,sha256=FlpEY8EANeXWKo_G5nmIotPquABZGyIJyk6HD9u6vqY,1533
|
|
89
91
|
logging.json,sha256=3RNjSADZmDq38eHePMm1CbP6qZ71AmpBtLwCmKU9Zgo,379
|
|
90
92
|
openapi.json,sha256=L1Ap1o6oAg2vKqjWohq4gl1-GpxezjlddS_oZHjS-xE,125227
|
|
91
|
-
langgraph_api-0.0.
|
|
92
|
-
langgraph_api-0.0.
|
|
93
|
-
langgraph_api-0.0.
|
|
94
|
-
langgraph_api-0.0.
|
|
95
|
-
langgraph_api-0.0.
|
|
93
|
+
langgraph_api-0.0.21.dist-info/LICENSE,sha256=ZPwVR73Biwm3sK6vR54djCrhaRiM4cAD2zvOQZV8Xis,3859
|
|
94
|
+
langgraph_api-0.0.21.dist-info/METADATA,sha256=MpWbFMLq8riGLaY9Y1vPsCQzGBu7hYNhnzV_Y-fgAjY,4038
|
|
95
|
+
langgraph_api-0.0.21.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
96
|
+
langgraph_api-0.0.21.dist-info/entry_points.txt,sha256=3EYLgj89DfzqJHHYGxPH4A_fEtClvlRbWRUHaXO7hj4,77
|
|
97
|
+
langgraph_api-0.0.21.dist-info/RECORD,,
|
langgraph_storage/ops.py
CHANGED
|
@@ -811,7 +811,7 @@ class Threads(Authenticated):
|
|
|
811
811
|
{
|
|
812
812
|
t["id"]: t["interrupts"]
|
|
813
813
|
for t in checkpoint["tasks"]
|
|
814
|
-
if t
|
|
814
|
+
if t.get("interrupts")
|
|
815
815
|
}
|
|
816
816
|
if checkpoint
|
|
817
817
|
else {}
|
|
@@ -1328,6 +1328,7 @@ class Runs(Authenticated):
|
|
|
1328
1328
|
metadata={
|
|
1329
1329
|
"graph_id": assistant["graph_id"],
|
|
1330
1330
|
"assistant_id": str(assistant_id),
|
|
1331
|
+
**metadata,
|
|
1331
1332
|
},
|
|
1332
1333
|
config=Runs._merge_jsonb(
|
|
1333
1334
|
assistant["config"],
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|