import { ... } from "@langchain/core/errors";Error class representing a context window overflow in a language model operation.
This error is thrown when the combined input to a language model (such as prompt tokens, historical messages, and/or instructions) exceeds the maximum context window or token limit that the model can process in a single request. Most models have defined upper limits for the number of tokens or characters allowed in a context, and exceeding this limit will prevent the operation from proceeding.
The ContextOverflowError extends the LangChainError base class with
the marker "context-overflow".
Base error class for all LangChain errors.
All LangChain error classes should extend this class (directly or
indirectly). Use LangChainError.isInstance(obj) to check if an
object is any LangChain error.
Error class representing an aborted model operation in LangChain.
This error is thrown when a model operation (such as invocation, streaming, or batching) is cancelled before it completes, commonly due to a user-initiated abort signal (e.g., via an AbortController) or an upstream cancellation event.
The ModelAbortError provides access to any partial output the model may have produced before the operation was interrupted, which can be useful for resuming work, debugging, or presenting incomplete results to users.
The error namespace for all LangChain errors