Skip to content

Commit 6f1d833

Browse files
missing types
1 parent c8a6ec3 commit 6f1d833

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

sentry_sdk/integrations/anthropic.py

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -711,35 +711,36 @@ def _sentry_patched_create_sync(*args: "Any", **kwargs: "Any") -> "Any":
711711
return _sentry_patched_create_sync
712712

713713

714-
def _initialize_data_accumulation_state(stream: "Union[Stream, MessageStream]"):
714+
def _initialize_data_accumulation_state(stream: "Union[Stream, MessageStream]") -> None:
715715
"""
716716
Initialize fields for accumulating output on the Stream instance.
717717
"""
718718
if not hasattr(stream, "_model"):
719719
stream._model = None
720720
stream._usage = _RecordedUsage()
721-
stream._content_blocks: "list[str]" = []
721+
stream._content_blocks = []
722722
stream._response_id = None
723723

724724

725725
def _accumulate_event_data(
726-
self, event: "Union[RawMessageStreamEvent, MessageStreamEvent]"
727-
):
726+
stream: "Union[Stream, MessageStream]",
727+
event: "Union[RawMessageStreamEvent, MessageStreamEvent]",
728+
) -> None:
728729
"""
729730
Update accumulated output from a single stream event.
730731
"""
731732
(model, usage, content_blocks, response_id) = _collect_ai_data(
732733
event,
733-
self._model,
734-
self._usage,
735-
self._content_blocks,
736-
self._response_id,
734+
stream._model,
735+
stream._usage,
736+
stream._content_blocks,
737+
stream._response_id,
737738
)
738739

739-
self._model = model
740-
self._usage = usage
741-
self._content_blocks = content_blocks
742-
self._response_id = response_id
740+
stream._model = model
741+
stream._usage = usage
742+
stream._content_blocks = content_blocks
743+
stream._response_id = response_id
743744

744745

745746
def _finish_streaming_span(
@@ -749,7 +750,7 @@ def _finish_streaming_span(
749750
usage: "_RecordedUsage",
750751
content_blocks: "list[str]",
751752
response_id: "Optional[str]",
752-
):
753+
) -> None:
753754
"""
754755
Set output attributes on the AI Client Span and end the span.
755756
"""

0 commit comments

Comments
 (0)