Skip to content

Conversation

@alexander-alderman-webb
Copy link
Contributor

@alexander-alderman-webb alexander-alderman-webb commented Nov 7, 2025

Description

According to the user in the issue gemini can return null values for chat completion text. Verify that that the messages are not null before calling model_dump().

See the corresponding schema: https://platform.openai.com/docs/api-reference/chat/object

Issues

Closes #5071

Reminders

@codecov
Copy link

codecov bot commented Nov 7, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.96%. Comparing base (2f966c6) to head (4e41f61).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5081      +/-   ##
==========================================
+ Coverage   83.94%   83.96%   +0.01%     
==========================================
  Files         179      179              
  Lines       17948    17948              
  Branches     3193     3193              
==========================================
+ Hits        15067    15070       +3     
+ Misses       1909     1906       -3     
  Partials      972      972              
Files with missing lines Coverage Δ
sentry_sdk/integrations/openai.py 84.84% <100.00%> (ø)

... and 1 file with indirect coverage changes

@alexander-alderman-webb alexander-alderman-webb marked this pull request as ready for review November 7, 2025 12:07
@alexander-alderman-webb alexander-alderman-webb requested a review from a team as a code owner November 7, 2025 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OpenAI integration fails when response has no messages in choices.

2 participants