@langchain/core 0.1.35 → 0.1.36

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.
@@ -1283,17 +1283,24 @@ class RunnableLambda extends Runnable {
1283
1283
  }
1284
1284
  async _invoke(input, config, runManager) {
1285
1285
  return new Promise((resolve, reject) => {
1286
- void index_js_1.AsyncLocalStorageProviderSingleton.getInstance().run(config, async () => {
1286
+ const childConfig = (0, config_js_1.patchConfig)(config, {
1287
+ callbacks: runManager?.getChild(),
1288
+ recursionLimit: (config?.recursionLimit ?? config_js_1.DEFAULT_RECURSION_LIMIT) - 1,
1289
+ });
1290
+ void index_js_1.AsyncLocalStorageProviderSingleton.getInstance().run(childConfig, async () => {
1287
1291
  try {
1288
- let output = await this.func(input, { ...config, config });
1292
+ let output = await this.func(input, {
1293
+ ...childConfig,
1294
+ config: childConfig,
1295
+ });
1289
1296
  if (output && Runnable.isRunnable(output)) {
1290
1297
  if (config?.recursionLimit === 0) {
1291
1298
  throw new Error("Recursion limit reached.");
1292
1299
  }
1293
- output = await output.invoke(input, (0, config_js_1.patchConfig)(config, {
1294
- callbacks: runManager?.getChild(),
1295
- recursionLimit: (config?.recursionLimit ?? config_js_1.DEFAULT_RECURSION_LIMIT) - 1,
1296
- }));
1300
+ output = await output.invoke(input, {
1301
+ ...childConfig,
1302
+ recursionLimit: (childConfig.recursionLimit ?? config_js_1.DEFAULT_RECURSION_LIMIT) - 1,
1303
+ });
1297
1304
  }
1298
1305
  resolve(output);
1299
1306
  }
@@ -1270,17 +1270,24 @@ export class RunnableLambda extends Runnable {
1270
1270
  }
1271
1271
  async _invoke(input, config, runManager) {
1272
1272
  return new Promise((resolve, reject) => {
1273
- void AsyncLocalStorageProviderSingleton.getInstance().run(config, async () => {
1273
+ const childConfig = patchConfig(config, {
1274
+ callbacks: runManager?.getChild(),
1275
+ recursionLimit: (config?.recursionLimit ?? DEFAULT_RECURSION_LIMIT) - 1,
1276
+ });
1277
+ void AsyncLocalStorageProviderSingleton.getInstance().run(childConfig, async () => {
1274
1278
  try {
1275
- let output = await this.func(input, { ...config, config });
1279
+ let output = await this.func(input, {
1280
+ ...childConfig,
1281
+ config: childConfig,
1282
+ });
1276
1283
  if (output && Runnable.isRunnable(output)) {
1277
1284
  if (config?.recursionLimit === 0) {
1278
1285
  throw new Error("Recursion limit reached.");
1279
1286
  }
1280
- output = await output.invoke(input, patchConfig(config, {
1281
- callbacks: runManager?.getChild(),
1282
- recursionLimit: (config?.recursionLimit ?? DEFAULT_RECURSION_LIMIT) - 1,
1283
- }));
1287
+ output = await output.invoke(input, {
1288
+ ...childConfig,
1289
+ recursionLimit: (childConfig.recursionLimit ?? DEFAULT_RECURSION_LIMIT) - 1,
1290
+ });
1284
1291
  }
1285
1292
  resolve(output);
1286
1293
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@langchain/core",
3
- "version": "0.1.35",
3
+ "version": "0.1.36",
4
4
  "description": "Core LangChain.js abstractions and schemas",
5
5
  "type": "module",
6
6
  "engines": {
@@ -43,7 +43,7 @@
43
43
  "camelcase": "6",
44
44
  "decamelize": "1.2.0",
45
45
  "js-tiktoken": "^1.0.8",
46
- "langsmith": "~0.1.1",
46
+ "langsmith": "~0.1.7",
47
47
  "ml-distance": "^4.0.0",
48
48
  "p-queue": "^6.6.2",
49
49
  "p-retry": "4",