We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c7a1b58 commit 33c63f6Copy full SHA for 33c63f6
1 file changed
sentry_sdk/ai/utils.py
@@ -503,8 +503,7 @@ def normalize_message_role(role: str) -> str:
503
Normalize a message role to one of the 4 allowed gen_ai role values.
504
Maps "ai" -> "assistant" and keeps other standard roles unchanged.
505
"""
506
- role_lower = role.lower()
507
- return GEN_AI_MESSAGE_ROLE_MAPPING.get(role_lower, role_lower)
+ return GEN_AI_MESSAGE_ROLE_MAPPING.get(role, role)
508
509
510
def normalize_message_roles(messages: "list[dict[str, Any]]") -> "list[dict[str, Any]]":
0 commit comments