Skip to content

Commit a01f7c1

Browse files
add docstring
1 parent e2d6d78 commit a01f7c1

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

sentry_sdk/integrations/anthropic.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,11 @@ def setup_once() -> None:
8282
def _wrap_stream_iter(
8383
f: "Callable[..., Iterator[RawMessageStreamEvent]]",
8484
) -> "Callable[..., Iterator[RawMessageStreamEvent]]":
85+
"""
86+
Sets information received while iterating the response stream on the AI Client Span.
87+
Responsible for closing the AI Client Span.
88+
"""
89+
8590
@wraps(f)
8691
def _patched_iter(self: "Stream") -> "Iterator[RawMessageStreamEvent]":
8792
if not hasattr(self, "_sentry_span"):
@@ -136,6 +141,11 @@ def _patched_iter(self: "Stream") -> "Iterator[RawMessageStreamEvent]":
136141
def _wrap_async_stream_aiter(
137142
f: "Callable[..., AsyncIterator[RawMessageStreamEvent]]",
138143
) -> "Callable[..., AsyncIterator[RawMessageStreamEvent]]":
144+
"""
145+
Sets information received while iterating the response stream on the AI Client Span.
146+
Responsible for closing the AI Client Span.
147+
"""
148+
139149
@wraps(f)
140150
async def _patched_aiter(
141151
self: "AsyncStream",

0 commit comments

Comments
 (0)