language_models: Treat a `block_reason` from Gemini as a refusal (#38670)
Marshall Bowers
created
This PR updates the Gemini provider to treat a
`prompt_feedback.block_reason` as a refusal, as Gemini does not seem to
return a `stop_reason` to use in this case.
<img width="639" height="162" alt="Screenshot 2025-09-22 at 4 23 15 PM"
src="https://github.com/user-attachments/assets/7a86d67e-06c1-49ea-b58f-fa80666f0f8c"
/>
Previously this would just result in no feedback to the user.
Release Notes:
- Added an error message when a Gemini response contains a
`block_reason`.