diff --git a/libs/langchain-anthropic/src/chat_models.ts b/libs/langchain-anthropic/src/chat_models.ts index 3583d8a69bd4..e4b6f37ef856 100644 --- a/libs/langchain-anthropic/src/chat_models.ts +++ b/libs/langchain-anthropic/src/chat_models.ts @@ -427,13 +427,16 @@ export class ChatAnthropicMessages< stream: false, }); - const stream = await this.createStreamWithRetry({ - ...params, - ...formattedMessages, - stream: true, - }, { - headers: options.headers, - }); + const stream = await this.createStreamWithRetry( + { + ...params, + ...formattedMessages, + stream: true, + }, + { + headers: options.headers, + } + ); for await (const data of stream) { if (options.signal?.aborted) {