@langchain/langgraph 0.2.11 → 0.2.13-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.d.ts +1 -1
- package/dist/graph/state.cjs +1 -1
- package/dist/graph/state.d.ts +1 -1
- package/dist/graph/state.js +1 -1
- package/dist/pregel/index.cjs +1 -1
- package/dist/pregel/index.d.ts +4 -4
- package/dist/pregel/index.js +1 -1
- package/dist/web.cjs +2 -2
- package/dist/web.d.ts +1 -1
- package/dist/web.js +1 -1
- package/package.json +6 -3
package/dist/graph/graph.d.ts
CHANGED
|
@@ -58,7 +58,7 @@ export declare class Graph<N extends string = typeof END, RunInput = any, RunOut
|
|
|
58
58
|
}): CompiledGraph<N>;
|
|
59
59
|
validate(interrupt?: string[]): void;
|
|
60
60
|
}
|
|
61
|
-
export declare class CompiledGraph<N extends string, RunInput = any, RunOutput = any> extends Pregel<Record<N | typeof START, PregelNode<RunInput, RunOutput>>, Record<N | typeof START | typeof END | string, BaseChannel>> {
|
|
61
|
+
export declare class CompiledGraph<N extends string, RunInput = any, RunOutput = any, ConfigurableFieldType extends Record<string, any> = Record<string, any>> extends Pregel<Record<N | typeof START, PregelNode<RunInput, RunOutput>>, Record<N | typeof START | typeof END | string, BaseChannel>, ConfigurableFieldType & Record<string, any>> {
|
|
62
62
|
NodeType: N;
|
|
63
63
|
RunInput: RunInput;
|
|
64
64
|
RunOutput: RunOutput;
|
package/dist/graph/state.cjs
CHANGED
|
@@ -424,7 +424,7 @@ class CompiledStateGraph extends graph_js_1.CompiledGraph {
|
|
|
424
424
|
return new write_js_1.ChannelWrite(writes, [constants_js_1.TAG_HIDDEN]);
|
|
425
425
|
},
|
|
426
426
|
// reader
|
|
427
|
-
(config) => read_js_1.ChannelRead.doRead(config, this.outputChannels, true)));
|
|
427
|
+
(config) => read_js_1.ChannelRead.doRead(config, this.streamChannels ?? this.outputChannels, true)));
|
|
428
428
|
// attach branch subscribers
|
|
429
429
|
const ends = branch.ends
|
|
430
430
|
? Object.values(branch.ends)
|
package/dist/graph/state.d.ts
CHANGED
|
@@ -122,7 +122,7 @@ export declare class StateGraph<SD extends StateDefinition | unknown, S = SD ext
|
|
|
122
122
|
interruptAfter?: N[] | All;
|
|
123
123
|
}): CompiledStateGraph<S, U, N, I, O, C>;
|
|
124
124
|
}
|
|
125
|
-
export declare class CompiledStateGraph<S, U, N extends string = typeof START, I extends StateDefinition = StateDefinition, O extends StateDefinition = StateDefinition, C extends StateDefinition = StateDefinition> extends CompiledGraph<N, S, U
|
|
125
|
+
export declare class CompiledStateGraph<S, U, N extends string = typeof START, I extends StateDefinition = StateDefinition, O extends StateDefinition = StateDefinition, C extends StateDefinition = StateDefinition> extends CompiledGraph<N, S, U, StateType<C>> {
|
|
126
126
|
builder: StateGraph<unknown, S, U, N, I, O, C>;
|
|
127
127
|
attachNode(key: typeof START, node?: never): void;
|
|
128
128
|
attachNode(key: N, node: StateGraphNodeSpec<S, U>): void;
|
package/dist/graph/state.js
CHANGED
|
@@ -420,7 +420,7 @@ export class CompiledStateGraph extends CompiledGraph {
|
|
|
420
420
|
return new ChannelWrite(writes, [TAG_HIDDEN]);
|
|
421
421
|
},
|
|
422
422
|
// reader
|
|
423
|
-
(config) => ChannelRead.doRead(config, this.outputChannels, true)));
|
|
423
|
+
(config) => ChannelRead.doRead(config, this.streamChannels ?? this.outputChannels, true)));
|
|
424
424
|
// attach branch subscribers
|
|
425
425
|
const ends = branch.ends
|
|
426
426
|
? Object.values(branch.ends)
|
package/dist/pregel/index.cjs
CHANGED
|
@@ -825,7 +825,7 @@ class Pregel extends runnables_1.Runnable {
|
|
|
825
825
|
await loop.store?.stop();
|
|
826
826
|
}
|
|
827
827
|
await Promise.all([
|
|
828
|
-
loop?.checkpointerPromises ?? [],
|
|
828
|
+
...(loop?.checkpointerPromises ?? []),
|
|
829
829
|
...Array.from(managed.values()).map((mv) => mv.promises()),
|
|
830
830
|
]);
|
|
831
831
|
}
|
package/dist/pregel/index.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ export declare class Channel {
|
|
|
23
23
|
/**
|
|
24
24
|
* Config for executing the graph.
|
|
25
25
|
*/
|
|
26
|
-
export interface PregelOptions<Nn extends StrRecord<string, PregelNode>, Cc extends StrRecord<string, BaseChannel | ManagedValueSpec>> extends RunnableConfig {
|
|
26
|
+
export interface PregelOptions<Nn extends StrRecord<string, PregelNode>, Cc extends StrRecord<string, BaseChannel | ManagedValueSpec>, ConfigurableFieldType extends Record<string, any> = Record<string, any>> extends RunnableConfig<ConfigurableFieldType> {
|
|
27
27
|
/** The stream mode for the graph run. Default is ["values"]. */
|
|
28
28
|
streamMode?: StreamMode | StreamMode[];
|
|
29
29
|
inputKeys?: keyof Cc | Array<keyof Cc>;
|
|
@@ -42,7 +42,7 @@ export interface PregelOptions<Nn extends StrRecord<string, PregelNode>, Cc exte
|
|
|
42
42
|
}
|
|
43
43
|
export type PregelInputType = any;
|
|
44
44
|
export type PregelOutputType = any;
|
|
45
|
-
export declare class Pregel<Nn extends StrRecord<string, PregelNode>, Cc extends StrRecord<string, BaseChannel | ManagedValueSpec>> extends Runnable<PregelInputType, PregelOutputType, PregelOptions<Nn, Cc>> implements PregelInterface<Nn, Cc> {
|
|
45
|
+
export declare class Pregel<Nn extends StrRecord<string, PregelNode>, Cc extends StrRecord<string, BaseChannel | ManagedValueSpec>, ConfigurableFieldType extends Record<string, any> = StrRecord<string, any>> extends Runnable<PregelInputType, PregelOutputType, PregelOptions<Nn, Cc, ConfigurableFieldType>> implements PregelInterface<Nn, Cc> {
|
|
46
46
|
static lc_name(): string;
|
|
47
47
|
lc_namespace: string[];
|
|
48
48
|
nodes: Nn;
|
|
@@ -118,7 +118,7 @@ export declare class Pregel<Nn extends StrRecord<string, PregelNode>, Cc extends
|
|
|
118
118
|
* @param options.interruptAfter Nodes to interrupt after.
|
|
119
119
|
* @param options.debug Whether to print debug information during execution.
|
|
120
120
|
*/
|
|
121
|
-
stream(input: PregelInputType, options?: Partial<PregelOptions<Nn, Cc>>): Promise<IterableReadableStream<PregelOutputType>>;
|
|
121
|
+
stream(input: PregelInputType, options?: Partial<PregelOptions<Nn, Cc, ConfigurableFieldType>>): Promise<IterableReadableStream<PregelOutputType>>;
|
|
122
122
|
protected prepareSpecs(config: RunnableConfig, options?: {
|
|
123
123
|
skipManaged?: boolean;
|
|
124
124
|
}): Promise<{
|
|
@@ -141,6 +141,6 @@ export declare class Pregel<Nn extends StrRecord<string, PregelNode>, Cc extends
|
|
|
141
141
|
* @param options.interruptAfter Nodes to interrupt after.
|
|
142
142
|
* @param options.debug Whether to print debug information during execution.
|
|
143
143
|
*/
|
|
144
|
-
invoke(input: PregelInputType, options?: Partial<PregelOptions<Nn, Cc>>): Promise<PregelOutputType>;
|
|
144
|
+
invoke(input: PregelInputType, options?: Partial<PregelOptions<Nn, Cc, ConfigurableFieldType>>): Promise<PregelOutputType>;
|
|
145
145
|
}
|
|
146
146
|
export {};
|
package/dist/pregel/index.js
CHANGED
|
@@ -818,7 +818,7 @@ export class Pregel extends Runnable {
|
|
|
818
818
|
await loop.store?.stop();
|
|
819
819
|
}
|
|
820
820
|
await Promise.all([
|
|
821
|
-
loop?.checkpointerPromises ?? [],
|
|
821
|
+
...(loop?.checkpointerPromises ?? []),
|
|
822
822
|
...Array.from(managed.values()).map((mv) => mv.promises()),
|
|
823
823
|
]);
|
|
824
824
|
}
|
package/dist/web.cjs
CHANGED
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.MessagesAnnotation = exports.
|
|
17
|
+
exports.MessagesAnnotation = exports.InMemoryStore = exports.AsyncBatchedStore = exports.BaseStore = exports.BaseCheckpointSaver = exports.emptyCheckpoint = exports.copyCheckpoint = exports.MemorySaver = exports.Send = exports.BinaryOperatorAggregate = exports.BaseChannel = exports.Annotation = exports.messagesStateReducer = exports.MessageGraph = exports.StateGraph = exports.START = exports.Graph = exports.END = void 0;
|
|
18
18
|
var index_js_1 = require("./graph/index.cjs");
|
|
19
19
|
Object.defineProperty(exports, "END", { enumerable: true, get: function () { return index_js_1.END; } });
|
|
20
20
|
Object.defineProperty(exports, "Graph", { enumerable: true, get: function () { return index_js_1.Graph; } });
|
|
@@ -36,7 +36,7 @@ Object.defineProperty(exports, "emptyCheckpoint", { enumerable: true, get: funct
|
|
|
36
36
|
Object.defineProperty(exports, "BaseCheckpointSaver", { enumerable: true, get: function () { return langgraph_checkpoint_1.BaseCheckpointSaver; } });
|
|
37
37
|
Object.defineProperty(exports, "BaseStore", { enumerable: true, get: function () { return langgraph_checkpoint_1.BaseStore; } });
|
|
38
38
|
Object.defineProperty(exports, "AsyncBatchedStore", { enumerable: true, get: function () { return langgraph_checkpoint_1.AsyncBatchedStore; } });
|
|
39
|
-
Object.defineProperty(exports, "
|
|
39
|
+
Object.defineProperty(exports, "InMemoryStore", { enumerable: true, get: function () { return langgraph_checkpoint_1.InMemoryStore; } });
|
|
40
40
|
__exportStar(require("./managed/index.cjs"), exports);
|
|
41
41
|
var messages_annotation_js_1 = require("./graph/messages_annotation.cjs");
|
|
42
42
|
Object.defineProperty(exports, "MessagesAnnotation", { enumerable: true, get: function () { return messages_annotation_js_1.MessagesAnnotation; } });
|
package/dist/web.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export { BaseChannel, type BinaryOperator, BinaryOperatorAggregate, type AnyValu
|
|
|
5
5
|
export { type AnnotationRoot as _INTERNAL_ANNOTATION_ROOT } from "./graph/index.js";
|
|
6
6
|
export { type RetryPolicy } from "./pregel/utils/index.js";
|
|
7
7
|
export { Send } from "./constants.js";
|
|
8
|
-
export { MemorySaver, type Checkpoint, type CheckpointMetadata, type CheckpointTuple, copyCheckpoint, emptyCheckpoint, BaseCheckpointSaver, type Item, type GetOperation, type SearchOperation, type PutOperation, type Operation, type OperationResults, BaseStore, AsyncBatchedStore,
|
|
8
|
+
export { MemorySaver, type Checkpoint, type CheckpointMetadata, type CheckpointTuple, copyCheckpoint, emptyCheckpoint, BaseCheckpointSaver, type Item, type GetOperation, type SearchOperation, type PutOperation, type Operation, type OperationResults, BaseStore, AsyncBatchedStore, InMemoryStore, type NameSpacePath, type NamespaceMatchType, type MatchCondition, type ListNamespacesOperation, } from "@langchain/langgraph-checkpoint";
|
|
9
9
|
export * from "./managed/index.js";
|
|
10
10
|
export { MessagesAnnotation } from "./graph/messages_annotation.js";
|
|
11
11
|
export { type LangGraphRunnableConfig } from "./pregel/runnable_types.js";
|
package/dist/web.js
CHANGED
|
@@ -2,6 +2,6 @@ export { END, Graph, START, StateGraph, MessageGraph, messagesStateReducer, Anno
|
|
|
2
2
|
export * from "./errors.js";
|
|
3
3
|
export { BaseChannel, BinaryOperatorAggregate, } from "./channels/index.js";
|
|
4
4
|
export { Send } from "./constants.js";
|
|
5
|
-
export { MemorySaver, copyCheckpoint, emptyCheckpoint, BaseCheckpointSaver, BaseStore, AsyncBatchedStore,
|
|
5
|
+
export { MemorySaver, copyCheckpoint, emptyCheckpoint, BaseCheckpointSaver, BaseStore, AsyncBatchedStore, InMemoryStore, } from "@langchain/langgraph-checkpoint";
|
|
6
6
|
export * from "./managed/index.js";
|
|
7
7
|
export { MessagesAnnotation } from "./graph/messages_annotation.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@langchain/langgraph",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.13-rc.0",
|
|
4
4
|
"description": "LangGraph",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -37,13 +37,14 @@
|
|
|
37
37
|
"zod": "^3.23.8"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"@langchain/core": ">=0.2.
|
|
40
|
+
"@langchain/core": ">=0.2.35 <0.3.0 || >=0.3.8 < 0.4.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@jest/globals": "^29.5.0",
|
|
44
44
|
"@langchain/anthropic": "^0.3.0",
|
|
45
45
|
"@langchain/community": "^0.3.0",
|
|
46
46
|
"@langchain/core": "^0.3.6",
|
|
47
|
+
"@langchain/langgraph-checkpoint-postgres": "workspace:*",
|
|
47
48
|
"@langchain/langgraph-checkpoint-sqlite": "workspace:*",
|
|
48
49
|
"@langchain/openai": "^0.3.0",
|
|
49
50
|
"@langchain/scripts": ">=0.1.3 <0.2.0",
|
|
@@ -51,6 +52,7 @@
|
|
|
51
52
|
"@swc/jest": "^0.2.29",
|
|
52
53
|
"@tsconfig/recommended": "^1.0.3",
|
|
53
54
|
"@types/double-ended-queue": "^2",
|
|
55
|
+
"@types/pg": "^8",
|
|
54
56
|
"@types/uuid": "^10",
|
|
55
57
|
"@typescript-eslint/eslint-plugin": "^6.12.0",
|
|
56
58
|
"@typescript-eslint/parser": "^6.12.0",
|
|
@@ -68,9 +70,10 @@
|
|
|
68
70
|
"jest": "^29.5.0",
|
|
69
71
|
"jest-environment-node": "^29.6.4",
|
|
70
72
|
"langchain": "^0.3.0",
|
|
73
|
+
"pg": "^8.13.0",
|
|
71
74
|
"prettier": "^2.8.3",
|
|
72
75
|
"release-it": "^17.6.0",
|
|
73
|
-
"rollup": "^4.
|
|
76
|
+
"rollup": "^4.23.0",
|
|
74
77
|
"ts-jest": "^29.1.0",
|
|
75
78
|
"tsx": "^4.7.0",
|
|
76
79
|
"typescript": "^4.9.5 || ^5.4.5",
|