@langchain/langgraph 0.0.7 → 0.0.9-rc.0
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/dist/graph/graph.cjs +1 -1
- package/dist/graph/graph.js +1 -1
- package/dist/pregel/index.cjs +3 -1
- package/dist/pregel/index.js +3 -1
- package/dist/setup/async_local_storage.cjs +9 -0
- package/dist/setup/async_local_storage.d.ts +1 -0
- package/dist/setup/async_local_storage.js +5 -0
- package/package.json +3 -3
package/dist/graph/graph.cjs
CHANGED
|
@@ -189,7 +189,7 @@ class Graph {
|
|
|
189
189
|
throw new Error(`Node \`${node}\` is a dead-end`);
|
|
190
190
|
}
|
|
191
191
|
}
|
|
192
|
-
const allEndsAreDefined = Object.values(this.branches).every((branchList) => branchList.every((branch) => branch.ends
|
|
192
|
+
const allEndsAreDefined = Object.values(this.branches).every((branchList) => branchList.every((branch) => branch.ends));
|
|
193
193
|
if (allEndsAreDefined) {
|
|
194
194
|
const allEnds = new Set([...this.edges]
|
|
195
195
|
.map(([_, end]) => end)
|
package/dist/graph/graph.js
CHANGED
|
@@ -186,7 +186,7 @@ export class Graph {
|
|
|
186
186
|
throw new Error(`Node \`${node}\` is a dead-end`);
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
|
-
const allEndsAreDefined = Object.values(this.branches).every((branchList) => branchList.every((branch) => branch.ends
|
|
189
|
+
const allEndsAreDefined = Object.values(this.branches).every((branchList) => branchList.every((branch) => branch.ends));
|
|
190
190
|
if (allEndsAreDefined) {
|
|
191
191
|
const allEnds = new Set([...this.edges]
|
|
192
192
|
.map(([_, end]) => end)
|
package/dist/pregel/index.cjs
CHANGED
|
@@ -12,6 +12,7 @@ const reserved_js_1 = require("./reserved.cjs");
|
|
|
12
12
|
const io_js_1 = require("./io.cjs");
|
|
13
13
|
const write_js_1 = require("./write.cjs");
|
|
14
14
|
const constants_js_1 = require("../constants.cjs");
|
|
15
|
+
const async_local_storage_js_1 = require("../setup/async_local_storage.cjs");
|
|
15
16
|
const DEFAULT_RECURSION_LIMIT = 25;
|
|
16
17
|
class GraphRecursionError extends Error {
|
|
17
18
|
constructor(message) {
|
|
@@ -95,7 +96,7 @@ class Pregel extends runnables_1.Runnable {
|
|
|
95
96
|
return "LangGraph";
|
|
96
97
|
}
|
|
97
98
|
constructor(fields) {
|
|
98
|
-
super();
|
|
99
|
+
super(fields);
|
|
99
100
|
// Because Pregel extends `Runnable`.
|
|
100
101
|
Object.defineProperty(this, "lc_namespace", {
|
|
101
102
|
enumerable: true,
|
|
@@ -157,6 +158,7 @@ class Pregel extends runnables_1.Runnable {
|
|
|
157
158
|
writable: true,
|
|
158
159
|
value: []
|
|
159
160
|
});
|
|
161
|
+
(0, async_local_storage_js_1.initializeAsyncLocalStorage)();
|
|
160
162
|
this.channels = fields.channels ?? this.channels;
|
|
161
163
|
this.output = fields.output ?? this.output;
|
|
162
164
|
this.input = fields.input ?? this.input;
|
package/dist/pregel/index.js
CHANGED
|
@@ -9,6 +9,7 @@ import { ReservedChannelsMap } from "./reserved.js";
|
|
|
9
9
|
import { mapInput, mapOutput } from "./io.js";
|
|
10
10
|
import { ChannelWrite } from "./write.js";
|
|
11
11
|
import { CONFIG_KEY_READ, CONFIG_KEY_SEND } from "../constants.js";
|
|
12
|
+
import { initializeAsyncLocalStorage } from "../setup/async_local_storage.js";
|
|
12
13
|
const DEFAULT_RECURSION_LIMIT = 25;
|
|
13
14
|
export class GraphRecursionError extends Error {
|
|
14
15
|
constructor(message) {
|
|
@@ -90,7 +91,7 @@ export class Pregel extends Runnable {
|
|
|
90
91
|
return "LangGraph";
|
|
91
92
|
}
|
|
92
93
|
constructor(fields) {
|
|
93
|
-
super();
|
|
94
|
+
super(fields);
|
|
94
95
|
// Because Pregel extends `Runnable`.
|
|
95
96
|
Object.defineProperty(this, "lc_namespace", {
|
|
96
97
|
enumerable: true,
|
|
@@ -152,6 +153,7 @@ export class Pregel extends Runnable {
|
|
|
152
153
|
writable: true,
|
|
153
154
|
value: []
|
|
154
155
|
});
|
|
156
|
+
initializeAsyncLocalStorage();
|
|
155
157
|
this.channels = fields.channels ?? this.channels;
|
|
156
158
|
this.output = fields.output ?? this.output;
|
|
157
159
|
this.input = fields.input ?? this.input;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.initializeAsyncLocalStorage = void 0;
|
|
4
|
+
const singletons_1 = require("@langchain/core/singletons");
|
|
5
|
+
const async_hooks_1 = require("async_hooks");
|
|
6
|
+
function initializeAsyncLocalStorage() {
|
|
7
|
+
singletons_1.AsyncLocalStorageProviderSingleton.initializeGlobalInstance(new async_hooks_1.AsyncLocalStorage());
|
|
8
|
+
}
|
|
9
|
+
exports.initializeAsyncLocalStorage = initializeAsyncLocalStorage;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function initializeAsyncLocalStorage(): void;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { AsyncLocalStorageProviderSingleton } from "@langchain/core/singletons";
|
|
2
|
+
import { AsyncLocalStorage } from "async_hooks";
|
|
3
|
+
export function initializeAsyncLocalStorage() {
|
|
4
|
+
AsyncLocalStorageProviderSingleton.initializeGlobalInstance(new AsyncLocalStorage());
|
|
5
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@langchain/langgraph",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.9-rc.0",
|
|
4
4
|
"description": "LangGraph",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -37,13 +37,13 @@
|
|
|
37
37
|
"author": "LangChain",
|
|
38
38
|
"license": "MIT",
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@langchain/core": "^0.1.
|
|
40
|
+
"@langchain/core": "^0.1.33"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@jest/globals": "^29.5.0",
|
|
44
44
|
"@langchain/community": "^0.0.27",
|
|
45
45
|
"@langchain/openai": "^0.0.14",
|
|
46
|
-
"@langchain/scripts": "
|
|
46
|
+
"@langchain/scripts": "latest",
|
|
47
47
|
"@swc/core": "^1.3.90",
|
|
48
48
|
"@swc/jest": "^0.2.29",
|
|
49
49
|
"@tsconfig/recommended": "^1.0.3",
|