@langchain/langgraph-api 1.0.0 → 1.0.1
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.
- package/CHANGELOG.md +7 -0
- package/dist/graph/load.utils.mjs +11 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -17,6 +17,13 @@ export async function resolveGraph(spec, options) {
|
|
|
17
17
|
return false;
|
|
18
18
|
return "compile" in graph && typeof graph.compile === "function";
|
|
19
19
|
};
|
|
20
|
+
const isCompiledGraph = (graph) => {
|
|
21
|
+
if (typeof graph !== "object" || graph == null)
|
|
22
|
+
return false;
|
|
23
|
+
return ("builder" in graph &&
|
|
24
|
+
typeof graph.builder === "object" &&
|
|
25
|
+
graph.builder != null);
|
|
26
|
+
};
|
|
20
27
|
const graph = await import(pathToFileURL(sourceFile).toString()).then((module) => module[exportSymbol || "default"]);
|
|
21
28
|
// obtain the graph, and if not compiled, compile it
|
|
22
29
|
const resolved = await (async () => {
|
|
@@ -24,6 +31,10 @@ export async function resolveGraph(spec, options) {
|
|
|
24
31
|
throw new Error("Failed to load graph: graph is nullush");
|
|
25
32
|
const afterResolve = (graphLike) => {
|
|
26
33
|
const graph = isGraph(graphLike) ? graphLike.compile() : graphLike;
|
|
34
|
+
// TODO: hack, remove once LangChain 1.x createAgent is fixed
|
|
35
|
+
if (!isCompiledGraph(graph) && "graph" in graph) {
|
|
36
|
+
return graph.graph;
|
|
37
|
+
}
|
|
27
38
|
return graph;
|
|
28
39
|
};
|
|
29
40
|
if (typeof graph === "function") {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@langchain/langgraph-api",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": "^18.19.0 || >=20.16.0"
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"@babel/code-frame": "^7.26.2",
|
|
65
65
|
"@hono/node-server": "^1.12.0",
|
|
66
66
|
"@hono/zod-validator": "^0.2.2",
|
|
67
|
-
"@langchain/langgraph-ui": "1.0.
|
|
67
|
+
"@langchain/langgraph-ui": "1.0.1",
|
|
68
68
|
"@types/json-schema": "^7.0.15",
|
|
69
69
|
"@typescript/vfs": "^1.6.0",
|
|
70
70
|
"dedent": "^1.5.3",
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
},
|
|
97
97
|
"devDependencies": {
|
|
98
98
|
"@langchain/core": "^1.0.0",
|
|
99
|
-
"@langchain/langgraph": "1.0.
|
|
99
|
+
"@langchain/langgraph": "1.0.1",
|
|
100
100
|
"@langchain/langgraph-checkpoint": "1.0.0",
|
|
101
101
|
"@langchain/langgraph-sdk": "1.0.0",
|
|
102
102
|
"@types/babel__code-frame": "^7.0.6",
|