We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4b40b3a commit 8aeea86Copy full SHA for 8aeea86
1 file changed
sentry_sdk/integrations/anthropic.py
@@ -844,28 +844,9 @@ def _wrap_async_close(
844
"""
845
846
async def close(self: "AsyncStream") -> None:
847
- if not hasattr(self, "_span"):
848
- return await f(self)
849
-
850
- if not hasattr(self, "_model"):
851
- self._span.__exit__(None, None, None)
852
- del self._span
+ with _StreamSpanContext(self):
853
return await f(self)
854
855
- _set_streaming_output_data(
856
- span=self._span,
857
- integration=self._integration,
858
- model=self._model,
859
- usage=self._usage,
860
- content_blocks=self._content_blocks,
861
- response_id=self._response_id,
862
- finish_reason=self._finish_reason,
863
- )
864
865
866
867
868
869
return close
870
871
0 commit comments