Skip to content

Commit a18e6a5

Browse files
committed
Better comments
1 parent 6c1c97d commit a18e6a5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

sentry_sdk/integrations/anthropic.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def _get_responses(content):
9292

9393
def _collect_ai_data(event, input_tokens, output_tokens, content_blocks):
9494
"""
95-
Count token usage and collect content blocks from the AI stream.
95+
Count token usage and collect content blocks from the AI streaming response.
9696
"""
9797
with capture_internal_exceptions():
9898
if hasattr(event, "type"):
@@ -115,7 +115,7 @@ def _add_ai_data_to_span(
115115
span, integration, content_blocks, input_tokens, output_tokens
116116
):
117117
"""
118-
Add token usage and content blocks to the span.
118+
Add token usage and content blocks from the AI streaming response to the span.
119119
"""
120120
with capture_internal_exceptions():
121121
if should_send_default_pii() and integration.include_prompts:
@@ -174,6 +174,7 @@ def _sentry_patched_create_common(f, *args, **kwargs):
174174
_calculate_token_usage(result, span)
175175
span.__exit__(None, None, None)
176176

177+
# Streaming response
177178
elif hasattr(result, "_iterator"):
178179
old_iterator = result._iterator
179180

0 commit comments

Comments
 (0)