@langchain/langgraph 0.0.9 → 0.0.10-rc.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.
@@ -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", new runnables_1.RunnableLambda({ func: runAgent }));
68
- workflow.addNode("action", new runnables_1.RunnableLambda({ func: executeTools }));
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", new RunnableLambda({ func: runAgent }));
65
- workflow.addNode("action", new RunnableLambda({ func: executeTools }));
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");
@@ -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, config) {
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;
@@ -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, config?: PregelOptions): Promise<PregelOutputType>;
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
  }
@@ -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, config) {
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.9",
3
+ "version": "0.0.10-rc.1",
4
4
  "description": "LangGraph",
5
5
  "type": "module",
6
6
  "engines": {
@@ -37,11 +37,11 @@
37
37
  "author": "LangChain",
38
38
  "license": "MIT",
39
39
  "dependencies": {
40
- "@langchain/core": "^0.1.33"
40
+ "@langchain/core": "^0.1.36"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@jest/globals": "^29.5.0",
44
- "@langchain/community": "^0.0.27",
44
+ "@langchain/community": "^0.0.33",
45
45
  "@langchain/openai": "^0.0.14",
46
46
  "@langchain/scripts": "~0.0",
47
47
  "@swc/core": "^1.3.90",
@@ -59,14 +59,15 @@
59
59
  "eslint-plugin-prettier": "^4.2.1",
60
60
  "jest": "^29.5.0",
61
61
  "jest-environment-node": "^29.6.4",
62
- "langchain": "^0.1.17",
62
+ "langchain": "^0.1.23",
63
63
  "prettier": "^2.8.3",
64
64
  "release-it": "^15.10.1",
65
65
  "rollup": "^4.5.2",
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",