Fix for Gemini 2.5 Pro and improve dependency handling#194
Merged
dwash96 merged 10 commits intocecli-dev:mainfrom Nov 27, 2025
Merged
Fix for Gemini 2.5 Pro and improve dependency handling#194dwash96 merged 10 commits intocecli-dev:mainfrom
dwash96 merged 10 commits intocecli-dev:mainfrom
Conversation
Co-authored-by: aider (openai/gemini_szmania/gemini-2.5-pro) <aider@aider.chat>
Co-authored-by: aider (openai/gemini_szmania/gemini-2.5-pro) <aider@aider.chat>
Co-authored-by: aider (openai/gemini_szmania/gemini-2.5-pro) <aider@aider.chat>
Co-authored-by: aider (openai/gemini_szmania/gemini-2.5-pro) <aider@aider.chat>
…e test Co-authored-by: aider (openai/gemini_szmania/gemini-2.5-pro) <aider@aider.chat>
Co-authored-by: aider (openai/gemini_szmania/gemini-2.5-pro) <aider@aider.chat>
Merged
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
This pull request introduces support for Google's Gemini 2.5 Pro model and other related Gemini models. Key improvements include adding new model aliases, enhancing environment validation to check for the
GEMINI_API_KEY, and implementing a user-friendly mechanism to detect and install required Python packages automatically.
Key Changes
1 Model Aliases and Configuration:
• Added new aliases in aider/models.py to easily access Gemini models, including:
• gemini-2.5-pro
• gemini (aliased to gemini/gemini-3-pro-preview)
• flash (aliased to gemini/gemini-2.5-flash)
• Updated the model validation logic to recognize and require the GEMINI_API_KEY environment variable when a Gemini model is selected.
2 Automatic Dependency Installation:
• To provide a smoother user experience, we've added a check that verifies if the necessary client library (google-generativeai) is installed when using Gemini models.
• If the package is missing, the system now raises a specific, informative error and prompts the user to install it automatically via pip, as seen in the new logic within aider/exceptions.py.
3 Enhanced Exception Handling:
• The LiteLLMExceptions class in aider/exceptions.py was updated to catch APIConnectionError related to google.auth issues. This allows us to provide a clear, actionable error message to the user instead of a
generic connection error.
4 Updated Tests:
• Added new asynchronous tests in tests/basic/test_models.py to validate the new dependency-checking functionality, ensuring the user is correctly prompted to install missing packages for various model providers
like Google (Vertex AI) and AWS (Bedrock).