-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Description
What specific problem does this solve?
Problem: Roo Code currently only supports Google's text-embedding-004 model, which is an older generation of embedding models. Users who want to leverage the newer, more powerful, and potentially more cost-effective gemini-embedding-exp-03-07 model are unable to do so.
Impact: This limits the quality and flexibility of the codebase indexing feature. The new Gemini model offers elastic output dimensions (3072, 1536, 768), allowing users to balance performance and cost, but this capability is currently inaccessible. Developers are forced to use an outdated model, which may not meet their project's requirements.
Additional context (optional)
The gemini-embedding-exp-03-07 model is Google's latest-generation embedding model and is the recommended model for new applications. Adding support for it will ensure Roo Code stays current with the latest AI technologies.
Roo Code Task Links (Optional)
No response
Request checklist
- I've searched existing Issues and Discussions for duplicates
- This describes a specific problem with clear impact and context
Interested in implementing this?
- Yes, I'd like to help implement this feature
Implementation requirements
- I understand this needs approval before implementation begins
How should this be solved? (REQUIRED if contributing, optional otherwise)
The solution involves adding support for the gemini-embedding-exp-03-07 model and its flexible output dimensions.
- Update Model Definitions: Add model profiles for
gemini-embedding-exp-03-07with dimensions 3072, 1536, and 768 tosrc/shared/embeddingModels.ts. - Update Embedder Logic: Modify the
GeminiEmbedderinsrc/services/code-index/embedders/gemini.tsto pass the selectedoutputDimensionto the underlying API. - Update Base Embedder: The
OpenAICompatibleEmbedderwill be updated to accept and handle theoutputDimensionparameter. - Bug Fix: A related
TypeErrorinwebviewMessageHandlerwill be fixed by adding a null check forprovider.codeIndexManager.
How will we know it works? (Acceptance Criteria - REQUIRED if contributing, optional otherwise)
Given a user wants to configure codebase indexing with the latest Google model
When they navigate to the "Roo-Code: Codebase Indexing Settings"
And select "Gemini" as the Embedder Provider
Then the "Select a model" dropdown should list gemini-embedding-exp-03-07 with options for 3072, 1536, and 768 dimensions.
And the user can select any of these options and save the settings without errors.
But the existing text-embedding-004 model must remain available and fully functional.
Technical considerations (REQUIRED if contributing, optional otherwise)
The implementation will affect the following files:
src/shared/embeddingModels.tssrc/services/code-index/embedders/gemini.tssrc/services/code-index/embedders/openai-compatible.tssrc/core/webview/webviewMessageHandler.tssrc/services/code-index/embedders/__tests__/gemini.spec.ts
Trade-offs and risks (REQUIRED if contributing, optional otherwise)
The primary risk was a potential regression in the webview, which manifested as a TypeError. This has been identified and fixed by adding a null check, making the implementation low-risk. There are no breaking changes, as the existing text-embedding-004 model is preserved.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status