-
Notifications
You must be signed in to change notification settings - Fork 2.8k
feat: Refactor Gemini and Vertex handlers to be fully independent #4375
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
daniel-lxs
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @kiwina, thank you for your contribution!
I left some suggestions in the code comments above. Let me know if you have any questions!
- Add vertexApiKey field to ProviderSettings for simplified authentication - Refactor VertexHandler to be fully independent from GeminiHandler - Remove inheritance dependency and vertex-specific logic from GeminiHandler - Implement standalone VertexHandler with vertex-only authentication methods - Add comprehensive debug logging for model selection and API flow - Update vertex provider UI to include API key input field - Add i18n support for vertex API key label and placeholder - Fix vertex tests to use correct default model (claude-sonnet-4@20250514) - Ensure proper model selection and fallback logic for both providers Breaking changes: - VertexHandler no longer inherits from GeminiHandler - Each provider now has completely separate model sets and authentication Closes: #TBD
- Added googleCloudApiKey translations for 16 non-English locales - Translations include proper localized terms for 'Vertex AI API Key' - All translation checks now pass successfully
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
|
Hey @kiwina, thank you for updating your PR, it seems like a test is failing, can you take a look before I review your changes? |
|
@kiwina are you going to be landing the plane on this or should we take it off your plate? |
Related GitHub Issue
Closes: #4374
Closes: #
Description
This PR significantly enhances the Vertex AI provider implementation with comprehensive refactoring and test improvements:
🔑 Vertex API Key Support
vertexApiKeyfield toProviderSettingsfor simplified authentication alongside existing JSON credentials and key file options🏗️ Provider Architecture Refactoring
VertexHandlerto be fully independent fromGeminiHandlersrc/utils/calculateCostGenai.ts🧪 Test Suite Enhancements
GeminiHandlertests: Enhanced from basic coverage to 26 comprehensive testsVertexHandlertests: Already comprehensive with 26 tests:thinkingsuffix) handling🔧 Technical Improvements
claude-sonnet-4@20250514)📊 Test Results
All tests pass with comprehensive coverage:
Test Procedure
Unit Tests
Manual Testing
Vertex API Key Configuration:
Provider Independence:
Cost Calculation:
Type of Change
Pre-Submission Checklist
Screenshots / Videos
The Vertex provider UI now includes an API key input field with proper validation and i18n support, matching the style of other provider configurations.
Breaking Changes
VertexHandlerno longer inherits fromGeminiHandlerHowever, the public API remains the same, so existing configurations and usage should continue to work.
Additional Notes
This refactoring significantly improves the maintainability and testability of the provider system:
The test suite improvements ensure that both providers maintain feature parity and consistent behavior while being completely independent implementations.