Skip to content

Commit 08dc0c2

Browse files
committed
correct model
1 parent 041844e commit 08dc0c2

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

sentry_sdk/integrations/cohere.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,14 +162,23 @@ def new_chat(*args: "Any", **kwargs: "Any") -> "Any":
162162
set_data_normalized(span, SPANDATA.GEN_AI_SYSTEM, "cohere")
163163
set_data_normalized(span, SPANDATA.GEN_AI_OPERATION_NAME, "chat")
164164
if model:
165-
set_data_normalized(span, SPANDATA.GEN_AI_RESPONSE_MODEL, model)
165+
set_data_normalized(span, SPANDATA.GEN_AI_REQUEST_MODEL, model)
166166

167167
if should_send_default_pii() and integration.include_prompts:
168168
messages = []
169169
for x in kwargs.get("chat_history", []):
170+
<<<<<<< HEAD
170171
messages.append(
171172
{
172173
"role": getattr(x, "role", "").lower(),
174+
=======
175+
role = getattr(x, "role", "").lower()
176+
if role == "chatbot":
177+
role = "assistant"
178+
messages.append(
179+
{
180+
"role": role,
181+
>>>>>>> c51eeb90 (correct model)
173182
"content": getattr(x, "message", ""),
174183
}
175184
)

sentry_sdk/integrations/cohere_v2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ def new_chat(*args, **kwargs):
185185
set_data_normalized(span, SPANDATA.GEN_AI_SYSTEM, "cohere")
186186
set_data_normalized(span, SPANDATA.GEN_AI_OPERATION_NAME, "chat")
187187
if model:
188-
set_data_normalized(span, SPANDATA.GEN_AI_RESPONSE_MODEL, model)
188+
set_data_normalized(span, SPANDATA.GEN_AI_REQUEST_MODEL, model)
189189

190190
if should_send_default_pii() and integration.include_prompts:
191191
messages = _extract_messages_v2(kwargs.get("messages", []))

0 commit comments

Comments
 (0)