Skip to content

Commit e4b8dae

Browse files
authored
fix(ai): Do not consume anthropic streaming stop (#4232)
The old functionality wouldn't re-emit the `stop` message for streaming Anthropic calls.
1 parent 8b40aa0 commit e4b8dae

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

sentry_sdk/integrations/anthropic.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,7 @@ def new_iterator():
184184
input_tokens, output_tokens, content_blocks = _collect_ai_data(
185185
event, input_tokens, output_tokens, content_blocks
186186
)
187-
if event.type != "message_stop":
188-
yield event
187+
yield event
189188

190189
_add_ai_data_to_span(
191190
span, integration, input_tokens, output_tokens, content_blocks
@@ -202,8 +201,7 @@ async def new_iterator_async():
202201
input_tokens, output_tokens, content_blocks = _collect_ai_data(
203202
event, input_tokens, output_tokens, content_blocks
204203
)
205-
if event.type != "message_stop":
206-
yield event
204+
yield event
207205

208206
_add_ai_data_to_span(
209207
span, integration, input_tokens, output_tokens, content_blocks

0 commit comments

Comments
 (0)