@langchain/langgraph 0.1.2 → 0.1.4-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.
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.empty = exports.createCheckpoint = exports.BaseChannel = void 0;
3
+ exports.BinaryOperatorAggregate = exports.empty = exports.createCheckpoint = exports.BaseChannel = void 0;
4
4
  var base_js_1 = require("./base.cjs");
5
5
  Object.defineProperty(exports, "BaseChannel", { enumerable: true, get: function () { return base_js_1.BaseChannel; } });
6
6
  Object.defineProperty(exports, "createCheckpoint", { enumerable: true, get: function () { return base_js_1.createCheckpoint; } });
7
7
  Object.defineProperty(exports, "empty", { enumerable: true, get: function () { return base_js_1.emptyChannels; } });
8
+ var binop_js_1 = require("./binop.cjs");
9
+ Object.defineProperty(exports, "BinaryOperatorAggregate", { enumerable: true, get: function () { return binop_js_1.BinaryOperatorAggregate; } });
@@ -1 +1,2 @@
1
1
  export { BaseChannel, createCheckpoint, emptyChannels as empty, } from "./base.js";
2
+ export { type BinaryOperator, BinaryOperatorAggregate } from "./binop.js";
@@ -1 +1,2 @@
1
1
  export { BaseChannel, createCheckpoint, emptyChannels as empty, } from "./base.js";
2
+ export { BinaryOperatorAggregate } from "./binop.js";
@@ -5,5 +5,5 @@ import { BaseMessage } from "@langchain/core/messages";
5
5
  * instances.
6
6
  */
7
7
  export declare const MessagesAnnotation: import("./annotation.js").AnnotationRoot<{
8
- messages: import("../channels/binop.js").BinaryOperatorAggregate<BaseMessage[], BaseMessage[]>;
8
+ messages: import("../web.js").BinaryOperatorAggregate<BaseMessage[], BaseMessage[]>;
9
9
  }>;
@@ -7,7 +7,7 @@ const runnables_1 = require("@langchain/core/runnables");
7
7
  const tool_executor_js_1 = require("./tool_executor.cjs");
8
8
  const state_js_1 = require("../graph/state.cjs");
9
9
  const index_js_1 = require("../graph/index.cjs");
10
- /** @ignore */
10
+ /** @deprecated Use {@link createReactAgent} instead with tool calling. */
11
11
  function createFunctionCallingExecutor({ model, tools, }) {
12
12
  let toolExecutor;
13
13
  let toolClasses;
@@ -4,11 +4,11 @@ import { RunnableToolLike } from "@langchain/core/runnables";
4
4
  import { ToolExecutor } from "./tool_executor.js";
5
5
  import { CompiledStateGraph } from "../graph/state.js";
6
6
  import { START } from "../graph/index.js";
7
- /** @ignore */
7
+ /** @deprecated Use {@link createReactAgent} instead with tool calling. */
8
8
  export type FunctionCallingExecutorState = {
9
9
  messages: Array<BaseMessage>;
10
10
  };
11
- /** @ignore */
11
+ /** @deprecated Use {@link createReactAgent} instead with tool calling. */
12
12
  export declare function createFunctionCallingExecutor<Model extends object>({ model, tools, }: {
13
13
  model: Model;
14
14
  tools: Array<StructuredToolInterface | RunnableToolLike> | ToolExecutor;
@@ -4,7 +4,7 @@ import { RunnableLambda, } from "@langchain/core/runnables";
4
4
  import { ToolExecutor } from "./tool_executor.js";
5
5
  import { StateGraph, } from "../graph/state.js";
6
6
  import { END, START } from "../graph/index.js";
7
- /** @ignore */
7
+ /** @deprecated Use {@link createReactAgent} instead with tool calling. */
8
8
  export function createFunctionCallingExecutor({ model, tools, }) {
9
9
  let toolExecutor;
10
10
  let toolClasses;
@@ -21,7 +21,7 @@ function createReactAgent(props) {
21
21
  const { llm, tools, messageModifier, checkpointSaver, interruptBefore, interruptAfter, } = props;
22
22
  const schema = {
23
23
  messages: {
24
- value: (left, right) => left.concat(right),
24
+ value: index_js_1.messagesStateReducer,
25
25
  default: () => [],
26
26
  },
27
27
  };
@@ -1,7 +1,7 @@
1
1
  import { isAIMessage, SystemMessage, } from "@langchain/core/messages";
2
2
  import { Runnable, RunnableLambda, } from "@langchain/core/runnables";
3
3
  import { ChatPromptTemplate } from "@langchain/core/prompts";
4
- import { END, START, StateGraph } from "../graph/index.js";
4
+ import { END, messagesStateReducer, START, StateGraph, } from "../graph/index.js";
5
5
  import { ToolNode } from "./tool_node.js";
6
6
  /**
7
7
  * Creates a StateGraph agent that relies on a chat llm utilizing tool calling.
@@ -18,7 +18,7 @@ export function createReactAgent(props) {
18
18
  const { llm, tools, messageModifier, checkpointSaver, interruptBefore, interruptAfter, } = props;
19
19
  const schema = {
20
20
  messages: {
21
- value: (left, right) => left.concat(right),
21
+ value: messagesStateReducer,
22
22
  default: () => [],
23
23
  },
24
24
  };
package/dist/web.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BaseCheckpointSaver = exports.emptyCheckpoint = exports.copyCheckpoint = exports.MemorySaver = exports.Send = exports.EmptyChannelError = exports.InvalidUpdateError = exports.GraphValueError = exports.GraphRecursionError = exports.Annotation = exports.messagesStateReducer = exports.MessageGraph = exports.StateGraph = exports.START = exports.Graph = exports.END = void 0;
3
+ exports.BaseCheckpointSaver = exports.emptyCheckpoint = exports.copyCheckpoint = exports.MemorySaver = exports.Send = exports.BinaryOperatorAggregate = exports.BaseChannel = exports.EmptyChannelError = exports.InvalidUpdateError = exports.GraphValueError = exports.GraphRecursionError = exports.Annotation = exports.messagesStateReducer = exports.MessageGraph = exports.StateGraph = exports.START = exports.Graph = exports.END = void 0;
4
4
  var index_js_1 = require("./graph/index.cjs");
5
5
  Object.defineProperty(exports, "END", { enumerable: true, get: function () { return index_js_1.END; } });
6
6
  Object.defineProperty(exports, "Graph", { enumerable: true, get: function () { return index_js_1.Graph; } });
@@ -14,6 +14,9 @@ Object.defineProperty(exports, "GraphRecursionError", { enumerable: true, get: f
14
14
  Object.defineProperty(exports, "GraphValueError", { enumerable: true, get: function () { return errors_js_1.GraphValueError; } });
15
15
  Object.defineProperty(exports, "InvalidUpdateError", { enumerable: true, get: function () { return errors_js_1.InvalidUpdateError; } });
16
16
  Object.defineProperty(exports, "EmptyChannelError", { enumerable: true, get: function () { return errors_js_1.EmptyChannelError; } });
17
+ var index_js_2 = require("./channels/index.cjs");
18
+ Object.defineProperty(exports, "BaseChannel", { enumerable: true, get: function () { return index_js_2.BaseChannel; } });
19
+ Object.defineProperty(exports, "BinaryOperatorAggregate", { enumerable: true, get: function () { return index_js_2.BinaryOperatorAggregate; } });
17
20
  var constants_js_1 = require("./constants.cjs");
18
21
  Object.defineProperty(exports, "Send", { enumerable: true, get: function () { return constants_js_1.Send; } });
19
22
  var langgraph_checkpoint_1 = require("@langchain/langgraph-checkpoint");
package/dist/web.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export { END, Graph, type StateGraphArgs, START, StateGraph, type CompiledStateGraph, MessageGraph, messagesStateReducer, Annotation, type StateType, type UpdateType, type CompiledGraph, } from "./graph/index.js";
2
2
  export { GraphRecursionError, GraphValueError, InvalidUpdateError, EmptyChannelError, } from "./errors.js";
3
+ export { BaseChannel, type BinaryOperator, BinaryOperatorAggregate, } from "./channels/index.js";
3
4
  export { type RetryPolicy } from "./pregel/utils.js";
4
5
  export { Send } from "./constants.js";
5
6
  export { MemorySaver, type Checkpoint, type CheckpointMetadata, type CheckpointTuple, copyCheckpoint, emptyCheckpoint, BaseCheckpointSaver, } from "@langchain/langgraph-checkpoint";
package/dist/web.js CHANGED
@@ -1,4 +1,5 @@
1
1
  export { END, Graph, START, StateGraph, MessageGraph, messagesStateReducer, Annotation, } from "./graph/index.js";
2
2
  export { GraphRecursionError, GraphValueError, InvalidUpdateError, EmptyChannelError, } from "./errors.js";
3
+ export { BaseChannel, BinaryOperatorAggregate, } from "./channels/index.js";
3
4
  export { Send } from "./constants.js";
4
5
  export { MemorySaver, copyCheckpoint, emptyCheckpoint, BaseCheckpointSaver, } from "@langchain/langgraph-checkpoint";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@langchain/langgraph",
3
- "version": "0.1.2",
3
+ "version": "0.1.4-rc.0",
4
4
  "description": "LangGraph",
5
5
  "type": "module",
6
6
  "engines": {
@@ -32,7 +32,7 @@
32
32
  "license": "MIT",
33
33
  "dependencies": {
34
34
  "@langchain/core": ">=0.2.20 <0.3.0",
35
- "@langchain/langgraph-checkpoint": "~0.0.2",
35
+ "@langchain/langgraph-checkpoint": "~0.0.3",
36
36
  "@langchain/langgraph-checkpoint-sqlite": "~0.0.1",
37
37
  "double-ended-queue": "^2.1.0-0",
38
38
  "uuid": "^10.0.0",
@@ -50,6 +50,7 @@
50
50
  "@jest/globals": "^29.5.0",
51
51
  "@langchain/anthropic": "^0.2.12",
52
52
  "@langchain/community": "^0.2.25",
53
+ "@langchain/core": "^0.2.29",
53
54
  "@langchain/openai": "^0.2.4",
54
55
  "@langchain/scripts": ">=0.1.2 <0.2.0",
55
56
  "@swc/core": "^1.3.90",