@langchain/langgraph 0.0.19 → 0.0.21
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/state.cjs
CHANGED
|
@@ -135,10 +135,16 @@ function _getChannels(schema) {
|
|
|
135
135
|
return channels;
|
|
136
136
|
}
|
|
137
137
|
function getChannel(reducer) {
|
|
138
|
-
if (reducer
|
|
138
|
+
if (typeof reducer === "object" &&
|
|
139
|
+
reducer &&
|
|
140
|
+
"reducer" in reducer &&
|
|
141
|
+
reducer.reducer) {
|
|
139
142
|
return new binop_js_1.BinaryOperatorAggregate(reducer.reducer, reducer.default);
|
|
140
143
|
}
|
|
141
|
-
if (reducer
|
|
144
|
+
if (typeof reducer === "object" &&
|
|
145
|
+
reducer &&
|
|
146
|
+
"value" in reducer &&
|
|
147
|
+
reducer.value) {
|
|
142
148
|
return new binop_js_1.BinaryOperatorAggregate(reducer.value, reducer.default);
|
|
143
149
|
}
|
|
144
150
|
return new last_value_js_1.LastValue();
|
package/dist/graph/state.js
CHANGED
|
@@ -131,10 +131,16 @@ function _getChannels(schema) {
|
|
|
131
131
|
return channels;
|
|
132
132
|
}
|
|
133
133
|
function getChannel(reducer) {
|
|
134
|
-
if (reducer
|
|
134
|
+
if (typeof reducer === "object" &&
|
|
135
|
+
reducer &&
|
|
136
|
+
"reducer" in reducer &&
|
|
137
|
+
reducer.reducer) {
|
|
135
138
|
return new BinaryOperatorAggregate(reducer.reducer, reducer.default);
|
|
136
139
|
}
|
|
137
|
-
if (reducer
|
|
140
|
+
if (typeof reducer === "object" &&
|
|
141
|
+
reducer &&
|
|
142
|
+
"value" in reducer &&
|
|
143
|
+
reducer.value) {
|
|
138
144
|
return new BinaryOperatorAggregate(reducer.value, reducer.default);
|
|
139
145
|
}
|
|
140
146
|
return new LastValue();
|
package/dist/pregel/index.cjs
CHANGED
|
@@ -222,6 +222,7 @@ class Pregel extends runnables_1.Runnable {
|
|
|
222
222
|
next: nextTasks.map((task) => task.name),
|
|
223
223
|
metadata: saved?.metadata,
|
|
224
224
|
config: saved ? saved.config : config,
|
|
225
|
+
createdAt: saved?.checkpoint.ts,
|
|
225
226
|
parentConfig: saved?.parentConfig,
|
|
226
227
|
};
|
|
227
228
|
}
|
|
@@ -238,6 +239,7 @@ class Pregel extends runnables_1.Runnable {
|
|
|
238
239
|
next: nextTasks.map((task) => task.name),
|
|
239
240
|
metadata: saved.metadata,
|
|
240
241
|
config: saved.config,
|
|
242
|
+
createdAt: saved.checkpoint.ts,
|
|
241
243
|
parentConfig: saved.parentConfig,
|
|
242
244
|
};
|
|
243
245
|
}
|
package/dist/pregel/index.js
CHANGED
|
@@ -218,6 +218,7 @@ export class Pregel extends Runnable {
|
|
|
218
218
|
next: nextTasks.map((task) => task.name),
|
|
219
219
|
metadata: saved?.metadata,
|
|
220
220
|
config: saved ? saved.config : config,
|
|
221
|
+
createdAt: saved?.checkpoint.ts,
|
|
221
222
|
parentConfig: saved?.parentConfig,
|
|
222
223
|
};
|
|
223
224
|
}
|
|
@@ -234,6 +235,7 @@ export class Pregel extends Runnable {
|
|
|
234
235
|
next: nextTasks.map((task) => task.name),
|
|
235
236
|
metadata: saved.metadata,
|
|
236
237
|
config: saved.config,
|
|
238
|
+
createdAt: saved.checkpoint.ts,
|
|
237
239
|
parentConfig: saved.parentConfig,
|
|
238
240
|
};
|
|
239
241
|
}
|
package/dist/pregel/types.d.ts
CHANGED
|
@@ -28,6 +28,10 @@ export interface StateSnapshot {
|
|
|
28
28
|
* Metadata about the checkpoint
|
|
29
29
|
*/
|
|
30
30
|
readonly metadata?: CheckpointMetadata;
|
|
31
|
+
/**
|
|
32
|
+
* Time when the snapshot was created
|
|
33
|
+
*/
|
|
34
|
+
readonly createdAt?: string;
|
|
31
35
|
/**
|
|
32
36
|
* Config used to fetch the parent snapshot, if any
|
|
33
37
|
* @default undefined
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { describe, it } from "@jest/globals";
|
|
2
2
|
import { ChatOpenAI } from "@langchain/openai";
|
|
3
3
|
import { HumanMessage, ToolMessage, } from "@langchain/core/messages";
|
|
4
|
-
import { Calculator } from "langchain/tools/calculator";
|
|
4
|
+
import { Calculator } from "@langchain/community/tools/calculator";
|
|
5
5
|
import { convertToOpenAITool } from "@langchain/core/utils/function_calling";
|
|
6
6
|
import { END, MessageGraph, START } from "../index.js";
|
|
7
7
|
describe("Chatbot", () => {
|
|
@@ -1809,6 +1809,8 @@ it("StateGraph start branch then end", async () => {
|
|
|
1809
1809
|
next: ["tool_two_slow"],
|
|
1810
1810
|
config: (await toolTwoWithCheckpointer.checkpointer.getTuple(thread1))
|
|
1811
1811
|
.config,
|
|
1812
|
+
createdAt: (await toolTwoWithCheckpointer.checkpointer.getTuple(thread1))
|
|
1813
|
+
.checkpoint.ts,
|
|
1812
1814
|
metadata: { source: "loop", step: 0, writes: null },
|
|
1813
1815
|
parentConfig: (await last(toolTwoWithCheckpointer.checkpointer.list(thread1, 2))).config,
|
|
1814
1816
|
});
|
|
@@ -1821,6 +1823,8 @@ it("StateGraph start branch then end", async () => {
|
|
|
1821
1823
|
next: [],
|
|
1822
1824
|
config: (await toolTwoWithCheckpointer.checkpointer.getTuple(thread1))
|
|
1823
1825
|
.config,
|
|
1826
|
+
createdAt: (await toolTwoWithCheckpointer.checkpointer.getTuple(thread1))
|
|
1827
|
+
.checkpoint.ts,
|
|
1824
1828
|
metadata: {
|
|
1825
1829
|
source: "loop",
|
|
1826
1830
|
step: 1,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@langchain/langgraph",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.21",
|
|
4
4
|
"description": "LangGraph",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -37,14 +37,14 @@
|
|
|
37
37
|
"author": "LangChain",
|
|
38
38
|
"license": "MIT",
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@langchain/core": "
|
|
40
|
+
"@langchain/core": ">0.1.61 <0.3.0",
|
|
41
41
|
"uuid": "^9.0.1"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@jest/globals": "^29.5.0",
|
|
45
45
|
"@langchain/anthropic": "^0.1.21",
|
|
46
|
-
"@langchain/community": "^0.
|
|
47
|
-
"@langchain/openai": "
|
|
46
|
+
"@langchain/community": "^0.2.2",
|
|
47
|
+
"@langchain/openai": "^0.0.33",
|
|
48
48
|
"@langchain/scripts": "^0.0.13",
|
|
49
49
|
"@swc/core": "^1.3.90",
|
|
50
50
|
"@swc/jest": "^0.2.29",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"eslint-plugin-prettier": "^4.2.1",
|
|
65
65
|
"jest": "^29.5.0",
|
|
66
66
|
"jest-environment-node": "^29.6.4",
|
|
67
|
-
"langchain": "^0.1
|
|
67
|
+
"langchain": "^0.2.1",
|
|
68
68
|
"prettier": "^2.8.3",
|
|
69
69
|
"release-it": "^15.10.1",
|
|
70
70
|
"rollup": "^4.5.2",
|