Skip to content

Commit

Permalink
ignore error mid stream
Browse files Browse the repository at this point in the history
  • Loading branch information
narengogi committed Nov 11, 2024
1 parent 38bb170 commit 90fb5ad
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/providers/anthropic/chatComplete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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' &&
Expand Down
2 changes: 1 addition & 1 deletion src/providers/google-vertex-ai/chatComplete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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' &&
Expand Down

0 comments on commit 90fb5ad

Please sign in to comment.