Skip to content

Fix for Gemini 2.5 Pro and improve dependency handling#194

Merged
dwash96 merged 10 commits intocecli-dev:mainfrom
szmania:gemini_2_5_pro_fix
Nov 27, 2025
Merged

Fix for Gemini 2.5 Pro and improve dependency handling#194
dwash96 merged 10 commits intocecli-dev:mainfrom
szmania:gemini_2_5_pro_fix

Conversation

@szmania
Copy link
Copy Markdown

@szmania szmania commented Nov 26, 2025

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).

szmania and others added 10 commits November 26, 2025 14:01
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>
@dwash96 dwash96 mentioned this pull request Nov 27, 2025
@dwash96 dwash96 merged commit e17c459 into cecli-dev:main Nov 27, 2025
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.

2 participants