langgraph-api 0.4.40__py3-none-any.whl → 0.5.6__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.

Files changed (41) hide show
  1. langgraph_api/__init__.py +1 -1
  2. langgraph_api/api/assistants.py +65 -61
  3. langgraph_api/api/meta.py +6 -0
  4. langgraph_api/api/threads.py +11 -7
  5. langgraph_api/auth/custom.py +29 -24
  6. langgraph_api/cli.py +2 -49
  7. langgraph_api/config.py +131 -16
  8. langgraph_api/graph.py +1 -1
  9. langgraph_api/grpc/client.py +183 -0
  10. langgraph_api/grpc/config_conversion.py +225 -0
  11. langgraph_api/grpc/generated/core_api_pb2.py +275 -0
  12. langgraph_api/{grpc_ops → grpc}/generated/core_api_pb2.pyi +35 -40
  13. langgraph_api/grpc/generated/engine_common_pb2.py +190 -0
  14. langgraph_api/grpc/generated/engine_common_pb2.pyi +634 -0
  15. langgraph_api/grpc/generated/engine_common_pb2_grpc.py +24 -0
  16. langgraph_api/grpc/ops.py +1045 -0
  17. langgraph_api/js/build.mts +1 -1
  18. langgraph_api/js/client.http.mts +1 -1
  19. langgraph_api/js/client.mts +1 -1
  20. langgraph_api/js/package.json +12 -12
  21. langgraph_api/js/src/graph.mts +20 -0
  22. langgraph_api/js/yarn.lock +176 -234
  23. langgraph_api/metadata.py +29 -21
  24. langgraph_api/queue_entrypoint.py +2 -2
  25. langgraph_api/route.py +14 -4
  26. langgraph_api/schema.py +2 -2
  27. langgraph_api/self_hosted_metrics.py +48 -2
  28. langgraph_api/serde.py +58 -14
  29. langgraph_api/server.py +16 -2
  30. langgraph_api/worker.py +1 -1
  31. {langgraph_api-0.4.40.dist-info → langgraph_api-0.5.6.dist-info}/METADATA +6 -6
  32. {langgraph_api-0.4.40.dist-info → langgraph_api-0.5.6.dist-info}/RECORD +38 -34
  33. langgraph_api/grpc_ops/client.py +0 -80
  34. langgraph_api/grpc_ops/generated/core_api_pb2.py +0 -274
  35. langgraph_api/grpc_ops/ops.py +0 -610
  36. /langgraph_api/{grpc_ops → grpc}/__init__.py +0 -0
  37. /langgraph_api/{grpc_ops → grpc}/generated/__init__.py +0 -0
  38. /langgraph_api/{grpc_ops → grpc}/generated/core_api_pb2_grpc.py +0 -0
  39. {langgraph_api-0.4.40.dist-info → langgraph_api-0.5.6.dist-info}/WHEEL +0 -0
  40. {langgraph_api-0.4.40.dist-info → langgraph_api-0.5.6.dist-info}/entry_points.txt +0 -0
  41. {langgraph_api-0.4.40.dist-info → langgraph_api-0.5.6.dist-info}/licenses/LICENSE +0 -0
@@ -1,7 +1,7 @@
1
1
  /// <reference types="./global.d.ts" />
2
2
  import "./src/preload.mjs";
3
3
 
4
- import { z } from "zod";
4
+ import { z } from "zod/v3";
5
5
  import * as fs from "node:fs/promises";
6
6
  import * as path from "node:path";
7
7
  import { type GraphSchema, resolveGraph } from "./src/graph.mts";
@@ -6,7 +6,7 @@ import * as path from "node:path";
6
6
  import * as url from "node:url";
7
7
  import { createLogger, format, transports } from "winston";
8
8
  import { gracefulExit } from "exit-hook";
9
- import { z } from "zod";
9
+ import { z } from "zod/v3";
10
10
 
11
11
  const logger = createLogger({
12
12
  level: "debug",
@@ -1,6 +1,6 @@
1
1
  /// <reference types="./global.d.ts" />
2
2
 
3
- import { z } from "zod";
3
+ import { z } from "zod/v3";
4
4
  import { Context, Hono } from "hono";
5
5
  import { serve } from "@hono/node-server";
6
6
  import { zValidator } from "@hono/zod-validator";
@@ -9,23 +9,23 @@
9
9
  "dependencies": {
10
10
  "@hono/node-server": "^1.12.0",
11
11
  "@hono/zod-validator": "^0.2.2",
12
- "@langchain/core": "^0.3.59",
13
- "@langchain/langgraph": "^0.2.65",
14
- "@langchain/langgraph-api": "~0.0.59",
15
- "@langchain/langgraph-ui": "~0.0.59",
16
- "@langchain/langgraph-checkpoint": "~0.0.18",
12
+ "@langchain/core": "^1.0.1",
13
+ "@langchain/langgraph": "^1.0.0",
14
+ "@langchain/langgraph-api": "^1.0.3",
15
+ "@langchain/langgraph-ui": "^1.0.3",
16
+ "@langchain/langgraph-checkpoint": "^1.0.0",
17
17
  "@types/json-schema": "^7.0.15",
18
18
  "@typescript/vfs": "^1.6.0",
19
- "dedent": "^1.5.3",
19
+ "dedent": "^1.7.0",
20
20
  "exit-hook": "^4.0.0",
21
- "hono": "^4.9.7",
21
+ "hono": "^4.10.4",
22
22
  "p-queue": "^8.0.1",
23
23
  "p-retry": "^6.2.0",
24
- "tsx": "^4.19.3",
24
+ "tsx": "^4.20.6",
25
25
  "typescript": "^5.5.4",
26
26
  "undici": "^6.21.2",
27
27
  "uuid": "^10.0.0",
28
- "vite": "^6.3.6",
28
+ "vite": "^6.4.1",
29
29
  "winston": "^3.17.0",
30
30
  "zod": "^3.25.32"
31
31
  },
@@ -40,8 +40,8 @@
40
40
  "@types/react-dom": "^19.0.3",
41
41
  "jose": "^6.0.10",
42
42
  "postgres": "^3.4.4",
43
- "prettier": "^3.3.3",
44
- "vitest": "^3.0.5"
43
+ "prettier": "^3.6.2",
44
+ "vitest": "^4.0.6"
45
45
  },
46
46
  "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
47
- }
47
+ }
@@ -62,6 +62,17 @@ export async function resolveGraph(
62
62
  return "compile" in graph && typeof graph.compile === "function";
63
63
  };
64
64
 
65
+ const isCompiledGraph = (
66
+ graph: GraphLike,
67
+ ): graph is CompiledGraph<string> => {
68
+ if (typeof graph !== "object" || graph == null) return false;
69
+ return (
70
+ "builder" in graph &&
71
+ typeof graph.builder === "object" &&
72
+ graph.builder != null
73
+ );
74
+ };
75
+
65
76
  const graph: GraphUnknown = await import(sourceFile).then(
66
77
  (module) => module[exportSymbol || "default"],
67
78
  );
@@ -73,6 +84,15 @@ export async function resolveGraph(
73
84
 
74
85
  const afterResolve = (graphLike: GraphLike): CompiledGraph<string> => {
75
86
  const graph = isGraph(graphLike) ? graphLike.compile() : graphLike;
87
+
88
+ // TODO: hack, remove once LangChain 1.x createAgent is fixed
89
+ // LangGraph API will assign it's checkpointer by setting it
90
+ // via `graph.checkpointer = ...` and `graph.store = ...`, and the 1.x `createAgent`
91
+ // hides the underlying `StateGraph` instance, so we need to access it directly.
92
+ if (!isCompiledGraph(graph) && "graph" in graph) {
93
+ return (graph as { graph: CompiledGraph<string> }).graph;
94
+ }
95
+
76
96
  return graph;
77
97
  };
78
98