diff --git a/sentry_sdk/integrations/openai.py b/sentry_sdk/integrations/openai.py index 19d7717b3c..315d54f750 100644 --- a/sentry_sdk/integrations/openai.py +++ b/sentry_sdk/integrations/openai.py @@ -237,7 +237,7 @@ def _set_output_data(span, response, kwargs, integration, finish_span=True): if hasattr(response, "choices"): if should_send_default_pii() and integration.include_prompts: - response_text = [choice.message.dict() for choice in response.choices] + response_text = [choice.message.model_dump() for choice in response.choices] if len(response_text) > 0: set_data_normalized(span, SPANDATA.GEN_AI_RESPONSE_TEXT, response_text)