Skip to content

Commit 08c1c23

Browse files
committed
finish reasons as array
1 parent 8025537 commit 08c1c23

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

sentry_sdk/integrations/cohere.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,10 @@ def collect_chat_response_fields(
113113

114114
for attr, spandata_key in COLLECTED_CHAT_RESP_ATTRS.items():
115115
if hasattr(res, attr):
116-
set_data_normalized(span, spandata_key, getattr(res, attr))
116+
value = getattr(res, attr)
117+
if spandata_key == SPANDATA.GEN_AI_RESPONSE_FINISH_REASONS:
118+
value = [value]
119+
set_data_normalized(span, spandata_key, value)
117120

118121
if hasattr(res, "meta"):
119122
if hasattr(res.meta, "billed_units"):

0 commit comments

Comments
 (0)