github langchain-ai/langchainjs @langchain/core@1.1.18

latest releases: @langchain/google-vertexai-web@2.1.14, @langchain/mistralai@1.0.4, @langchain/google-webauth@2.1.14...
9 hours ago

Patch Changes

  • #9900 a9b5059 Thanks @hntrl! - fix(core): update method signatures to use Partial<CallOptions> for options parameters

    Updated invoke, stream, generate, and generatePrompt method signatures across Runnable, BaseChatModel, and BaseLLM to correctly accept Partial<CallOptions> instead of full CallOptions. This aligns the implementation with the RunnableInterface specification and allows users to pass partial options (e.g., { signal: abortedSignal }) without TypeScript errors.

  • #9900 a9b5059 Thanks @hntrl! - Improved abort signal handling for chat models:

    • Added ModelAbortError class in @langchain/core/errors that contains partial output when a model invocation is aborted mid-stream
    • invoke() now throws ModelAbortError with accumulated partialOutput when aborted during streaming (when using streaming callback handlers)
    • stream() throws a regular AbortError when aborted (since chunks are already yielded to the caller)
    • All provider implementations now properly check and propagate abort signals in both _generate() and _streamResponseChunks() methods
    • Added standard tests for abort signal behavior

Don't miss a new langchainjs release

NewReleases is sending notifications on new releases.