Fix: Updated error message for Gemini API#14589
Merged
2 commits merged intoSep 20, 2025
Merged
Conversation
- Update exception mapping to show 'GeminiException' instead of 'VertexAIException' - Add comprehensive HTTP status code mapping for Gemini provider (401, 403, 404, 408, 429, 500+) - Maintain OpenAI-compatible error handling patterns - Use LlmProviders enum constants for consistent provider identification - Add comprehensive test coverage for Gemini exception mapping
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
ghost
reviewed
Sep 16, 2025
| model=model, | ||
| ) | ||
| elif custom_llm_provider == "palm" or custom_llm_provider == "gemini": | ||
| elif custom_llm_provider == "palm" or custom_llm_provider == LlmProviders.GEMINI: |
There was a problem hiding this comment.
@timelfrink we should not do this
- both google ai studio (
gemini/) and vertex ai (vertex_ai/) have the same set of error messages -
so we should use the same if/else block.
i agree on being more dynamic with the error string - to clarify the provider used
your pr can also clean up this code block - as it's a dead code block
5 tasks
This pull request was closed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Issue Reference
Closes #14586
Changes Made
litellm_core_utils/exception_mapping_utils.pyto properly handle Gemini provider exceptions with correct namingTest Plan