From 21a6cc853a284e618953d47d20aa54b73131e6b7 Mon Sep 17 00:00:00 2001 From: Alexander Alderman Webb Date: Thu, 21 May 2026 08:59:03 +0200 Subject: [PATCH] fix(anthropic): Do not set None gen_ai.response.model --- sentry_sdk/integrations/anthropic.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sentry_sdk/integrations/anthropic.py b/sentry_sdk/integrations/anthropic.py index 0773652a30..ececc612d4 100644 --- a/sentry_sdk/integrations/anthropic.py +++ b/sentry_sdk/integrations/anthropic.py @@ -562,7 +562,8 @@ def _set_output_data( ) -> None: """ Set output data for the span based on the AI response.""" - span.set_data(SPANDATA.GEN_AI_RESPONSE_MODEL, model) + if model is not None: + span.set_data(SPANDATA.GEN_AI_RESPONSE_MODEL, model) if response_id is not None: span.set_data(SPANDATA.GEN_AI_RESPONSE_ID, response_id) if finish_reason is not None: