diff --git a/src/providers/anthropic/chatComplete.ts b/src/providers/anthropic/chatComplete.ts index a6ac100e2..680dc75b5 100644 --- a/src/providers/anthropic/chatComplete.ts +++ b/src/providers/anthropic/chatComplete.ts @@ -481,7 +481,7 @@ export const AnthropicChatCompleteStreamChunkTransform: ( const parsedChunk: AnthropicChatCompleteStreamResponse = JSON.parse(chunk); - if (parsedChunk.type === 'error') return 'data: [DONE]\n\n'; + if (parsedChunk.type === 'error') return; if ( parsedChunk.type === 'content_block_start' && diff --git a/src/providers/google-vertex-ai/chatComplete.ts b/src/providers/google-vertex-ai/chatComplete.ts index e2f8f651c..057562b80 100644 --- a/src/providers/google-vertex-ai/chatComplete.ts +++ b/src/providers/google-vertex-ai/chatComplete.ts @@ -894,7 +894,7 @@ export const VertexAnthropicChatCompleteStreamChunkTransform: ( const parsedChunk: AnthropicChatCompleteStreamResponse = JSON.parse(chunk); - if (parsedChunk.type === 'error') return 'data: [DONE]\n\n'; + if (parsedChunk.type === 'error') return; if ( parsedChunk.type === 'content_block_start' &&