@langchain/core 1.0.0-alpha.1 → 1.0.0-alpha.2

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.
@@ -3,7 +3,7 @@ import { ToolInputParsingException, _isToolCall } from "../tools/utils.js";
3
3
  import { AsyncLocalStorageProviderSingleton } from "../singletons/async_local_storage/index.js";
4
4
  import "../singletons/index.js";
5
5
  import { DEFAULT_RECURSION_LIMIT, ensureConfig, getCallbackManagerForConfig, mergeConfigs, patchConfig, pickRunnableConfigKeys } from "./config.js";
6
- import { raceWithSignal } from "../utils/signal.js";
6
+ import { getAbortSignalError, raceWithSignal } from "../utils/signal.js";
7
7
  import { AsyncGeneratorWithSetup, IterableReadableStream, atee, concat, pipeGeneratorWithSetup } from "../utils/stream.js";
8
8
  import { LogStreamCallbackHandler, RunLog, RunLogPatch, isLogStreamHandler } from "../tracers/log_stream.js";
9
9
  import { EventStreamCallbackHandler, isStreamEventsHandler } from "../tracers/event_stream.js";
@@ -986,7 +986,7 @@ var RunnableSequence = class RunnableSequence extends Runnable {
986
986
  const promise = step.invoke(nextStepInput, patchConfig(config, { callbacks: runManager?.getChild(this.omitSequenceTags ? void 0 : `seq:step:${i + 1}`) }));
987
987
  nextStepInput = await raceWithSignal(promise, options?.signal);
988
988
  }
989
- if (options?.signal?.aborted) throw new Error("Aborted");
989
+ if (options?.signal?.aborted) throw getAbortSignalError(options.signal);
990
990
  finalOutput = await this.last.invoke(nextStepInput, patchConfig(config, { callbacks: runManager?.getChild(this.omitSequenceTags ? void 0 : `seq:step:${this.steps.length}`) }));
991
991
  } catch (e) {
992
992
  await runManager?.handleChainError(e);