Skip to content

Commit 5b4bba9

Browse files
authored
fix(anthropic): preserve streaming helper methods in instrumentation (#3377)
1 parent 7b994c0 commit 5b4bba9

File tree

6 files changed

+812
-141
lines changed

6 files changed

+812
-141
lines changed

packages/opentelemetry-instrumentation-anthropic/opentelemetry/instrumentation/anthropic/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
set_response_attributes,
1818
)
1919
from opentelemetry.instrumentation.anthropic.streaming import (
20-
abuild_from_streaming_response,
21-
build_from_streaming_response,
20+
AnthropicAsyncStream,
21+
AnthropicStream,
2222
WrappedAsyncMessageStreamManager,
2323
WrappedMessageStreamManager,
2424
)
@@ -558,7 +558,7 @@ def _wrap(
558558
end_time = time.time()
559559

560560
if is_streaming_response(response):
561-
return build_from_streaming_response(
561+
return AnthropicStream(
562562
span,
563563
response,
564564
instance._client,
@@ -679,7 +679,7 @@ async def _awrap(
679679
raise e
680680

681681
if is_streaming_response(response):
682-
return abuild_from_streaming_response(
682+
return AnthropicAsyncStream(
683683
span,
684684
response,
685685
instance._client,

0 commit comments

Comments
 (0)