@langchain/langgraph 0.0.10-rc.0 → 0.0.10
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.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export interface StateGraphArgs<Channels extends Record<string, any>> {
|
|
|
10
10
|
[K in keyof Channels]: {
|
|
11
11
|
value: BinaryOperator<Channels[K]> | null;
|
|
12
12
|
default?: () => Channels[K];
|
|
13
|
-
};
|
|
13
|
+
} | string;
|
|
14
14
|
} | {
|
|
15
15
|
value: BinaryOperator<unknown> | null;
|
|
16
16
|
default?: () => unknown;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createAgentExecutor = void 0;
|
|
4
|
-
const runnables_1 = require("@langchain/core/runnables");
|
|
5
4
|
const tool_executor_js_1 = require("./tool_executor.cjs");
|
|
6
5
|
const state_js_1 = require("../graph/state.cjs");
|
|
7
6
|
const index_js_1 = require("../index.cjs");
|
|
@@ -64,8 +63,8 @@ function createAgentExecutor({ agentRunnable, tools, inputSchema, }) {
|
|
|
64
63
|
channels: state,
|
|
65
64
|
});
|
|
66
65
|
// Define the two nodes we will cycle between
|
|
67
|
-
workflow.addNode("agent",
|
|
68
|
-
workflow.addNode("action",
|
|
66
|
+
workflow.addNode("agent", runAgent);
|
|
67
|
+
workflow.addNode("action", executeTools);
|
|
69
68
|
// Set the entrypoint as `agent`
|
|
70
69
|
// This means that this node is the first one called
|
|
71
70
|
workflow.setEntryPoint("agent");
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { RunnableLambda, } from "@langchain/core/runnables";
|
|
2
1
|
import { ToolExecutor } from "./tool_executor.js";
|
|
3
2
|
import { StateGraph } from "../graph/state.js";
|
|
4
3
|
import { END } from "../index.js";
|
|
@@ -61,8 +60,8 @@ export function createAgentExecutor({ agentRunnable, tools, inputSchema, }) {
|
|
|
61
60
|
channels: state,
|
|
62
61
|
});
|
|
63
62
|
// Define the two nodes we will cycle between
|
|
64
|
-
workflow.addNode("agent",
|
|
65
|
-
workflow.addNode("action",
|
|
63
|
+
workflow.addNode("agent", runAgent);
|
|
64
|
+
workflow.addNode("action", executeTools);
|
|
66
65
|
// Set the entrypoint as `agent`
|
|
67
66
|
// This means that this node is the first one called
|
|
68
67
|
workflow.setEntryPoint("agent");
|
package/dist/pregel/index.cjs
CHANGED
|
@@ -277,11 +277,9 @@ class Pregel extends runnables_1.Runnable {
|
|
|
277
277
|
this.checkpointer.put(config, checkpoint);
|
|
278
278
|
}
|
|
279
279
|
}
|
|
280
|
-
async invoke(input,
|
|
280
|
+
async invoke(input, options) {
|
|
281
|
+
const config = (0, runnables_1.ensureConfig)(options);
|
|
281
282
|
if (!config?.outputKeys) {
|
|
282
|
-
if (!config) {
|
|
283
|
-
config = {};
|
|
284
|
-
}
|
|
285
283
|
config.outputKeys = this.output;
|
|
286
284
|
}
|
|
287
285
|
let latest;
|
package/dist/pregel/index.d.ts
CHANGED
|
@@ -70,7 +70,7 @@ export declare class Pregel extends Runnable<PregelInputType, PregelOutputType,
|
|
|
70
70
|
interrupt: string[];
|
|
71
71
|
constructor(fields: PregelInterface);
|
|
72
72
|
_transform(input: AsyncGenerator<PregelInputType>, runManager?: CallbackManagerForChainRun, config?: RunnableConfig & Partial<Record<string, unknown>>): AsyncGenerator<PregelOutputType>;
|
|
73
|
-
invoke(input: PregelInputType,
|
|
73
|
+
invoke(input: PregelInputType, options?: PregelOptions): Promise<PregelOutputType>;
|
|
74
74
|
stream(input: PregelInputType, config?: PregelOptions): Promise<IterableReadableStream<PregelOutputType>>;
|
|
75
75
|
transform(generator: AsyncGenerator<PregelInputType>, config?: PregelOptions): AsyncGenerator<PregelOutputType>;
|
|
76
76
|
}
|
package/dist/pregel/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable no-param-reassign */
|
|
2
|
-
import { Runnable, _coerceToRunnable, patchConfig, } from "@langchain/core/runnables";
|
|
2
|
+
import { Runnable, _coerceToRunnable, ensureConfig, patchConfig, } from "@langchain/core/runnables";
|
|
3
3
|
import { IterableReadableStream } from "@langchain/core/utils/stream";
|
|
4
4
|
import { EmptyChannelError, createCheckpoint, emptyChannels, } from "../channels/base.js";
|
|
5
5
|
import { emptyCheckpoint, } from "../checkpoint/base.js";
|
|
@@ -272,11 +272,9 @@ export class Pregel extends Runnable {
|
|
|
272
272
|
this.checkpointer.put(config, checkpoint);
|
|
273
273
|
}
|
|
274
274
|
}
|
|
275
|
-
async invoke(input,
|
|
275
|
+
async invoke(input, options) {
|
|
276
|
+
const config = ensureConfig(options);
|
|
276
277
|
if (!config?.outputKeys) {
|
|
277
|
-
if (!config) {
|
|
278
|
-
config = {};
|
|
279
|
-
}
|
|
280
278
|
config.outputKeys = this.output;
|
|
281
279
|
}
|
|
282
280
|
let latest;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@langchain/langgraph",
|
|
3
|
-
"version": "0.0.10
|
|
3
|
+
"version": "0.0.10",
|
|
4
4
|
"description": "LangGraph",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -66,7 +66,8 @@
|
|
|
66
66
|
"ts-jest": "^29.1.0",
|
|
67
67
|
"tsx": "^4.7.0",
|
|
68
68
|
"typescript": "<5.2.0",
|
|
69
|
-
"zod": "^3.22.4"
|
|
69
|
+
"zod": "^3.22.4",
|
|
70
|
+
"zod-to-json-schema": "^3.22.4"
|
|
70
71
|
},
|
|
71
72
|
"publishConfig": {
|
|
72
73
|
"access": "public",
|