Skip to content

Conversation

@sonald
Copy link

@sonald sonald commented Apr 21, 2025

Title

make sure response has at least one choice

Relevant issues

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • My PR's scope is as isolated as possible, it only solves 1 specific problem

Type

🐛 Bug Fix

Changes

gemini-2.5-pro-preview-03-25 at some cases will respond with a non-error message that has neither candidates nor promptFeedback, like this:

{
  "usageMetadata": {
    "promptTokenCount": 9291,
    "totalTokenCount": 9291,
    "promptTokensDetails": [
      {
        "modality": "TEXT",
        "tokenCount": 9291
      }
    ]
  },
  "modelVersion": "gemini-2.5-pro-preview-03-25"
}

this breaks apps like smolagents, this is a related issue on smolagents.

@vercel
Copy link

vercel bot commented Apr 21, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
litellm ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 22, 2025 7:40am

@krrishdholakia
Copy link
Contributor

Hey @sonald can you add a unit test for this change in here

@CLAassistant
Copy link

CLAassistant commented Apr 22, 2025

CLA assistant check
All committers have signed the CLA.

@sonald
Copy link
Author

sonald commented Apr 25, 2025

@krrishdholakia I have added the test

@github-actions
Copy link

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@github-actions github-actions bot added the stale label Jul 25, 2025
@github-actions github-actions bot closed this Aug 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants