@langchain/core 0.2.33 → 0.2.34

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.
@@ -433,7 +433,7 @@ class Runnable extends serializable_js_1.Serializable {
433
433
  }
434
434
  else {
435
435
  const copiedCallbacks = callbacks.copy();
436
- copiedCallbacks.inheritableHandlers.push(logStreamCallbackHandler);
436
+ copiedCallbacks.addHandler(logStreamCallbackHandler, true);
437
437
  // eslint-disable-next-line no-param-reassign
438
438
  config.callbacks = copiedCallbacks;
439
439
  }
@@ -503,7 +503,7 @@ class Runnable extends serializable_js_1.Serializable {
503
503
  }
504
504
  else {
505
505
  const copiedCallbacks = callbacks.copy();
506
- copiedCallbacks.inheritableHandlers.push(eventStreamer);
506
+ copiedCallbacks.addHandler(eventStreamer, true);
507
507
  // eslint-disable-next-line no-param-reassign
508
508
  config.callbacks = copiedCallbacks;
509
509
  }
@@ -426,7 +426,7 @@ export class Runnable extends Serializable {
426
426
  }
427
427
  else {
428
428
  const copiedCallbacks = callbacks.copy();
429
- copiedCallbacks.inheritableHandlers.push(logStreamCallbackHandler);
429
+ copiedCallbacks.addHandler(logStreamCallbackHandler, true);
430
430
  // eslint-disable-next-line no-param-reassign
431
431
  config.callbacks = copiedCallbacks;
432
432
  }
@@ -496,7 +496,7 @@ export class Runnable extends Serializable {
496
496
  }
497
497
  else {
498
498
  const copiedCallbacks = callbacks.copy();
499
- copiedCallbacks.inheritableHandlers.push(eventStreamer);
499
+ copiedCallbacks.addHandler(eventStreamer, true);
500
500
  // eslint-disable-next-line no-param-reassign
501
501
  config.callbacks = copiedCallbacks;
502
502
  }
@@ -273,7 +273,7 @@ class EventStreamCallbackHandler extends base_js_1.BaseTracer {
273
273
  throw new Error(`onLLMNewToken: Run ID ${run.id} not found in run map.`);
274
274
  }
275
275
  // Top-level streaming events are covered by tapOutputIterable
276
- if (run.parent_run_id === undefined) {
276
+ if (this.runInfoMap.size === 1) {
277
277
  return;
278
278
  }
279
279
  if (runInfo.runType === "chat_model") {
@@ -269,7 +269,7 @@ export class EventStreamCallbackHandler extends BaseTracer {
269
269
  throw new Error(`onLLMNewToken: Run ID ${run.id} not found in run map.`);
270
270
  }
271
271
  // Top-level streaming events are covered by tapOutputIterable
272
- if (run.parent_run_id === undefined) {
272
+ if (this.runInfoMap.size === 1) {
273
273
  return;
274
274
  }
275
275
  if (runInfo.runType === "chat_model") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@langchain/core",
3
- "version": "0.2.33",
3
+ "version": "0.2.34",
4
4
  "description": "Core LangChain.js abstractions and schemas",
5
5
  "type": "module",
6
6
  "engines": {