feat: add custom base URL support for Gemini embedding provider #5745
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.
This PR implements custom base URL support for the Gemini embedding provider in Codebase Indexing, addressing issue #5744.
Changes Made
Backend Infrastructure
codebaseIndexGeminiBaseUrlfield to bothcodebaseIndexProviderSchemaandcodebaseIndexConfigSchemainpackages/types/src/codebase-index.tsCodeIndexConfigManagerto:geminiOptionswith proper typingCodeIndexServiceFactoryto pass the base URL parameter toGeminiEmbedderconstructorGeminiEmbedderalready accepts an optionalbaseUrlparameterFrontend Implementation
CodeIndexPopover.tsxpositioned between API key and model selectionLocalCodeIndexSettingsinterface to include the new fieldTesting
config-manager.spec.tsfor:service-factory.spec.tswith test cases for:CodeIndexPopover.validation.spec.tsxfor:Technical Implementation
The implementation follows the existing patterns used by other providers (OpenAI Compatible, Ollama) that already support custom base URLs. The feature is:
Use Cases
This enables users to:
generativelanguage.googleapis.comTesting
Fixes #5744
Important
Add support for custom base URLs in Gemini embedding provider, updating backend and frontend components with comprehensive testing.
codebaseIndexGeminiBaseUrltocodebaseIndexProviderSchemaandcodebaseIndexConfigSchemaincodebase-index.ts.CodeIndexConfigManagerto load/store Gemini base URL and detect restart on changes.CodeIndexServiceFactoryto pass base URL toGeminiEmbedder.CodeIndexPopover.tsxwith validation.LocalCodeIndexSettingsto include new field.config-manager.spec.tsfor configuration loading and restart detection.service-factory.spec.tsforGeminiEmbeddercreation with/without base URL.CodeIndexPopover.validation.spec.tsxfor Gemini base URL.This description was created by
for 4cfc69f. You can customize this summary. It will automatically update as commits are pushed.