Skip to content

Commit 2ff1c5d

Browse files
ref(cohere): Remove set_data_normalized for primitive attributes
1 parent 594dce5 commit 2ff1c5d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

sentry_sdk/integrations/cohere.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def collect_chat_response_fields(
111111

112112
for attr in COLLECTED_CHAT_RESP_ATTRS:
113113
if hasattr(res, attr):
114-
set_data_normalized(span, "ai." + attr, getattr(res, attr))
114+
span.set_data("ai." + attr, getattr(res, attr))
115115

116116
if hasattr(res, "meta"):
117117
if hasattr(res.meta, "billed_units"):
@@ -180,8 +180,8 @@ def new_chat(*args: "Any", **kwargs: "Any") -> "Any":
180180

181181
for k, v in COLLECTED_CHAT_PARAMS.items():
182182
if k in kwargs:
183-
set_data_normalized(span, v, kwargs[k])
184-
set_data_normalized(span, SPANDATA.AI_STREAMING, False)
183+
span.set_data(v, kwargs[k])
184+
span.set_data(SPANDATA.AI_STREAMING, False)
185185

186186
if streaming:
187187
old_iterator = res
@@ -212,7 +212,7 @@ def new_iterator() -> "Iterator[StreamedChatResponse]":
212212
)
213213
span.__exit__(None, None, None)
214214
else:
215-
set_data_normalized(span, "unknown_response", True)
215+
span.set_data("unknown_response", True)
216216
span.__exit__(None, None, None)
217217
return res
218218

@@ -246,7 +246,7 @@ def new_embed(*args: "Any", **kwargs: "Any") -> "Any":
246246
)
247247

248248
if "model" in kwargs:
249-
set_data_normalized(span, SPANDATA.AI_MODEL_ID, kwargs["model"])
249+
span.set_data(SPANDATA.AI_MODEL_ID, kwargs["model"])
250250
try:
251251
res = f(*args, **kwargs)
252252
except Exception as e:

0 commit comments

Comments
 (0)