Skip to content

Commit 33c63f6

Browse files
committed
fix
1 parent c7a1b58 commit 33c63f6

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

sentry_sdk/ai/utils.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -503,8 +503,7 @@ def normalize_message_role(role: str) -> str:
503503
Normalize a message role to one of the 4 allowed gen_ai role values.
504504
Maps "ai" -> "assistant" and keeps other standard roles unchanged.
505505
"""
506-
role_lower = role.lower()
507-
return GEN_AI_MESSAGE_ROLE_MAPPING.get(role_lower, role_lower)
506+
return GEN_AI_MESSAGE_ROLE_MAPPING.get(role, role)
508507

509508

510509
def normalize_message_roles(messages: "list[dict[str, Any]]") -> "list[dict[str, Any]]":

0 commit comments

Comments
 (0)