feat: Refactor Gemini and Vertex handlers to be fully independent #4374
Labels
enhancement
New feature or request
Issue - In Progress
Someone is actively working on this. Should link to a PR soon.
Summary
Refactor the Gemini and Vertex model provider handlers to be fully independent, eliminating shared logic and inheritance. This improves code maintainability, reduces coupling, and ensures each handler operates with provider-specific logic.
Problem
Currently, the VertexHandler inherits from GeminiHandler, which creates several issues:
Solution
Changes Made
GeminiHandler (
src/api/providers/gemini.ts
)isVertex
, vertex credentials)geminiApiKey
andgeminiModels
VertexHandler (
src/api/providers/vertex.ts
)getModel()
method for troubleshootingvertexModels
andvertexDefaultModelId
exclusivelyTests Updated
claude-sonnet-4@20250514
)Benefits
Testing
Files Changed
src/api/providers/gemini.ts
- Refactored to pure Gemini implementationsrc/api/providers/vertex.ts
- Standalone Vertex implementation with enhanced debuggingsrc/api/providers/__tests__/vertex.test.ts
- Updated test expectationsType of Change
This refactoring improves code quality while maintaining full backward compatibility and makes future maintenance much easier.
The text was updated successfully, but these errors were encountered: