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.
cohere
1 parent 38c14e9 commit ec23396Copy full SHA for ec23396
sentry_sdk/integrations/cohere.py
@@ -22,7 +22,11 @@
22
try:
23
from cohere.client import Client
24
from cohere.base_client import BaseCohere
25
- from cohere import ChatStreamEndEvent, NonStreamedChatResponse
+ from cohere import (
26
+ ChatStreamEndEvent,
27
+ NonStreamedChatResponse,
28
+ StreamedChatResponse_StreamEnd,
29
+ )
30
31
if TYPE_CHECKING:
32
from cohere import StreamedChatResponse
@@ -181,7 +185,9 @@ def new_iterator():
181
185
182
186
with capture_internal_exceptions():
183
187
for x in old_iterator:
184
- if isinstance(x, ChatStreamEndEvent):
188
+ if isinstance(x, ChatStreamEndEvent) or isinstance(
189
+ x, StreamedChatResponse_StreamEnd
190
+ ):
191
collect_chat_response_fields(
192
span,
193
x.response,
0 commit comments