@langchain/langgraph 0.0.10 → 0.0.12

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,4 +1,4 @@
1
- import { RunnableBinding, RunnableEach, RunnableLambda, RunnablePassthrough, _coerceToRunnable, } from "@langchain/core/runnables";
1
+ import { RunnableBinding, RunnableLambda, RunnablePassthrough, _coerceToRunnable, } from "@langchain/core/runnables";
2
2
  import { CONFIG_KEY_READ } from "../constants.js";
3
3
  export class ChannelRead extends RunnableLambda {
4
4
  constructor(channel) {
@@ -139,73 +139,3 @@ export class ChannelInvoke extends RunnableBinding {
139
139
  }
140
140
  }
141
141
  }
142
- export class ChannelBatch extends RunnableEach {
143
- constructor(fields) {
144
- super({
145
- ...fields,
146
- bound: fields.bound ?? defaultRunnableBound,
147
- });
148
- Object.defineProperty(this, "lc_graph_name", {
149
- enumerable: true,
150
- configurable: true,
151
- writable: true,
152
- value: "ChannelBatch"
153
- });
154
- Object.defineProperty(this, "channel", {
155
- enumerable: true,
156
- configurable: true,
157
- writable: true,
158
- value: void 0
159
- });
160
- Object.defineProperty(this, "key", {
161
- enumerable: true,
162
- configurable: true,
163
- writable: true,
164
- value: void 0
165
- });
166
- this.channel = fields.channel;
167
- this.key = fields.key;
168
- }
169
- join(channels) {
170
- if (!this.key) {
171
- throw new Error(`Cannot join() additional channels without a key.\nPass a key arg to Channel.subscribeToEach().`);
172
- }
173
- const channelsMap = {};
174
- for (const chan of channels) {
175
- channelsMap[chan] = new ChannelRead(chan);
176
- }
177
- const joiner = RunnablePassthrough.assign({ ...channelsMap });
178
- if (this.bound === defaultRunnableBound) {
179
- return new ChannelBatch({
180
- channel: this.channel,
181
- key: this.key,
182
- bound: joiner,
183
- });
184
- }
185
- else {
186
- return new ChannelBatch({
187
- channel: this.channel,
188
- key: this.key,
189
- bound: this.bound.pipe(joiner),
190
- });
191
- }
192
- }
193
- // @ts-expect-error @TODO: fix later
194
- pipe(coerceable) {
195
- if (this.bound === defaultRunnableBound) {
196
- return new ChannelBatch({
197
- channel: this.channel,
198
- key: this.key,
199
- bound: _coerceToRunnable(coerceable),
200
- });
201
- }
202
- else {
203
- // Delegate to `or` in `this.bound`
204
- return new ChannelBatch({
205
- channel: this.channel,
206
- key: this.key,
207
- bound: this.bound.pipe(coerceable),
208
- });
209
- }
210
- }
211
- }
@@ -15,12 +15,9 @@ function validateGraph({ nodes, channels, input, output, hidden, interrupt, }) {
15
15
  Object.values(node.channels).map((channel) => subscribedChannels.add(channel));
16
16
  }
17
17
  }
18
- else if (node.lc_graph_name === "ChannelBatch" && "channel" in node) {
19
- subscribedChannels.add(node.channel);
20
- }
21
18
  else {
22
19
  console.error(node);
23
- throw new Error(`Invalid node type: ${JSON.stringify(node, null, 2)}, expected Channel.subscribeTo() or Channel.subscribe_to_each()`);
20
+ throw new Error(`Invalid node type: ${JSON.stringify(node, null, 2)}, expected Channel.subscribeTo()`);
24
21
  }
25
22
  }
26
23
  for (const chan of [...subscribedChannels]) {
@@ -1,7 +1,7 @@
1
1
  import { BaseChannel } from "../channels/index.js";
2
- import { ChannelBatch, ChannelInvoke } from "./read.js";
2
+ import { ChannelInvoke } from "./read.js";
3
3
  export declare function validateGraph({ nodes, channels, input, output, hidden, interrupt, }: {
4
- nodes: Record<string, ChannelInvoke | ChannelBatch>;
4
+ nodes: Record<string, ChannelInvoke>;
5
5
  channels: {
6
6
  [key: string]: BaseChannel;
7
7
  };
@@ -12,12 +12,9 @@ export function validateGraph({ nodes, channels, input, output, hidden, interrup
12
12
  Object.values(node.channels).map((channel) => subscribedChannels.add(channel));
13
13
  }
14
14
  }
15
- else if (node.lc_graph_name === "ChannelBatch" && "channel" in node) {
16
- subscribedChannels.add(node.channel);
17
- }
18
15
  else {
19
16
  console.error(node);
20
- throw new Error(`Invalid node type: ${JSON.stringify(node, null, 2)}, expected Channel.subscribeTo() or Channel.subscribe_to_each()`);
17
+ throw new Error(`Invalid node type: ${JSON.stringify(node, null, 2)}, expected Channel.subscribeTo()`);
21
18
  }
22
19
  }
23
20
  for (const chan of [...subscribedChannels]) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@langchain/langgraph",
3
- "version": "0.0.10",
3
+ "version": "0.0.12",
4
4
  "description": "LangGraph",
5
5
  "type": "module",
6
6
  "engines": {
@@ -37,12 +37,12 @@
37
37
  "author": "LangChain",
38
38
  "license": "MIT",
39
39
  "dependencies": {
40
- "@langchain/core": "^0.1.36"
40
+ "@langchain/core": "^0.1.51"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@jest/globals": "^29.5.0",
44
- "@langchain/community": "^0.0.33",
45
- "@langchain/openai": "^0.0.14",
44
+ "@langchain/community": "^0.0.43",
45
+ "@langchain/openai": "^0.0.23",
46
46
  "@langchain/scripts": "~0.0",
47
47
  "@swc/core": "^1.3.90",
48
48
  "@swc/jest": "^0.2.29",
@@ -59,7 +59,7 @@
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.23",
62
+ "langchain": "^0.1.29",
63
63
  "prettier": "^2.8.3",
64
64
  "release-it": "^15.10.1",
65
65
  "rollup": "^4.5.2",