Skip to content

Commit fee196b

Browse files
committed
update regex pattern
1 parent 735ec54 commit fee196b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/providers/anthropic/chatComplete.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ export const AnthropicChatCompleteStreamChunkTransform: (
485485
chunk = chunk.replace(/^event: content_block_start[\r\n]*/, '');
486486
chunk = chunk.replace(/^event: message_delta[\r\n]*/, '');
487487
chunk = chunk.replace(/^event: message_start[\r\n]*/, '');
488-
chunk = chunk.replace(/^event: error/, '');
488+
chunk = chunk.replace(/^event: error[\r\n]*/, '');
489489
chunk = chunk.replace(/^data: /, '');
490490
chunk = chunk.trim();
491491

src/providers/google-vertex-ai/chatComplete.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -988,7 +988,7 @@ export const VertexAnthropicChatCompleteStreamChunkTransform: (
988988
chunk = chunk.replace(/^event: content_block_start[\r\n]*/, '');
989989
chunk = chunk.replace(/^event: message_delta[\r\n]*/, '');
990990
chunk = chunk.replace(/^event: message_start[\r\n]*/, '');
991-
chunk = chunk.replace(/^event: error/, '');
991+
chunk = chunk.replace(/^event: error[\r\n]*/, '');
992992
chunk = chunk.replace(/^data: /, '');
993993
chunk = chunk.trim();
994994

0 commit comments

Comments
 (0)