-
Notifications
You must be signed in to change notification settings - Fork 2.6k
feat: add Vertex AI as embedder provider for codebase indexing #6301
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
- Add "vertex" to EmbedderProvider type - Add Vertex AI embedding models to EMBEDDING_MODEL_PROFILES - Create VertexEmbedder implementation using OpenAI-compatible approach - Update service factory to handle vertex provider - Add vertexOptions to CodeIndexConfig interface - Update CodeIndexPopover UI to include Vertex AI section - Add translation keys for Vertex AI - Add VERTEX_MAX_ITEM_TOKENS constant - Add comprehensive tests for VertexEmbedder Closes #6300
- Add "vertex" to EmbedderProvider type - Add Vertex AI embedding models (text-embedding-004, text-multilingual-embedding-002, etc.) - Create VertexEmbedder implementation using OpenAI-compatible approach - Update service factory to handle vertex provider - Add vertexOptions to CodeIndexConfig interface - Update CodeIndexPopover UI to include Vertex AI section - Add translation keys for Vertex AI - Add comprehensive tests for VertexEmbedder - Update type definitions to include vertex in codebaseIndexModels Closes #6300
|
@roomote-agent
|
|
Hi @diwakar-s-maurya, I see your request to:
I'll work on implementing these changes now. |
…le auth options - Replace OpenAI-compatible approach with native @google/genai SDK - Add support for multiple authentication methods: - API key (uses regular Gemini API endpoint) - JSON credentials (service account) - Key file path - Application default credentials - Add projectId and location fields for Vertex AI configuration - Update UI to show all authentication options for Vertex - Update tests to reflect new implementation - Update all related type definitions and interfaces
|
@diwakar-s-maurya I've successfully implemented the requested changes! 🎉 Summary of Changes:1. Replaced OpenAI-compatible approach with @google/genai library
2. Added multiple authentication options (similar to Gemini provider):
3. Added required Vertex AI configuration fields:
4. Updated UI components:
5. Updated all related files:
All tests are passing locally, and the CI checks are currently running. The implementation now properly uses the Let me know if you need any adjustments or have questions about the implementation! |
|
|
||
| // Validate required fields | ||
| if (!projectId) { | ||
| throw new Error("Project ID is required for Vertex AI") |
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.
Consider using a translatable string (e.g., t("embeddings:vertexConfig.projectIdRequired")) instead of the hard-coded error message "Project ID is required for Vertex AI" for consistency.
| throw new Error("Project ID is required for Vertex AI") | |
| throw new Error(t("embeddings:vertexConfig.projectIdRequired")) |
This comment was generated because it violated a code review rule: irule_C0ez7Rji6ANcGkkX.
| throw new Error("Project ID is required for Vertex AI") | ||
| } | ||
| if (!location) { | ||
| throw new Error("Location is required for Vertex AI") |
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.
Similarly, use the translation function for the error thrown when location is missing (e.g., t("embeddings:vertexConfig.locationRequired")) instead of the hard-coded message.
| throw new Error("Location is required for Vertex AI") | |
| throw new Error(t("embeddings:vertexConfig.locationRequired")) |
This comment was generated because it violated a code review rule: irule_C0ez7Rji6ANcGkkX.
|
@roomote-agent
|
|
Hi @diwakar-s-maurya, I see your request to:
I'll work on implementing these changes now. |
- Remove API Key field from Vertex AI embedder configuration - Change all input fields to plain text (not password type) - Use consistent field labels from providers section - Update validation to remove API key requirement
|
@diwakar-s-maurya I've successfully implemented the requested changes! ✅ Summary of Changes:
All tests are passing locally, and the changes maintain consistency with the existing Vertex AI provider settings UI. The CI checks are currently running. |
|
@diwakar-s-maurya I noticed the translation check is failing. This is because the original PR that added Vertex AI support included many new translation keys that haven't been translated to all supported languages yet. The missing translations are for the Vertex AI feature itself (not related to my changes). The failing translations include keys like:
These translations would need to be added for all 17 supported languages. Would you like me to help with adding these translations, or would you prefer to handle them separately? |
|
@roomote-agent
|
|
Hi @diwakar-s-maurya! I see your feedback:
I'll work on these changes right away. |
- Changed 'Vertex AI' to 'GCP Vertex AI' in all language files - Removed unused translation keys (vertexApiKeyLabel and vertexAuthMethodLabel) - Updated translations for: ca, de, en, es, fr, hi, id, it, ja, ko, nl, pl, pt-BR, ru, tr, vi, zh-CN, zh-TW
|
✅ I've completed the requested translation changes:
Note: The translation check is currently failing because there are many other new Vertex AI-related translation keys that need to be added to all non-English language files. These include:
These additional translations are part of the overall Vertex AI feature implementation and were not part of the specific changes requested in this comment. |
|
Hey @diwakar-s-maurya I'll be closing this for now, feel free to create a PR |
This PR adds support for Google Cloud Vertex AI as an embedder provider for codebase indexing, implementing the feature requested in issue #6300.
Changes
EmbedderProvidertypeVertexEmbedderimplementation using OpenAI-compatible approachvertexOptionstoCodeIndexConfiginterfaceCodeIndexPopoverUI component to include Vertex AI sectioncodebaseIndexModelsImplementation Details
The Vertex AI embedder follows the same pattern as the existing Gemini embedder, using the OpenAI-compatible approach with the Vertex AI base URL (
https://generativelanguage.googleapis.com/v1beta/).Testing
Closes #6300
Important
Adds Google Cloud Vertex AI as an embedder provider for codebase indexing, including new models, UI updates, and tests.
EmbedderProvidertype inembeddingModels.ts.VertexEmbedderclass invertex.tsfor Google Cloud Vertex AI.service-factory.tsto handle Vertex AI as a provider.vertexOptionstoCodeIndexConfiginconfig.ts.CodeIndexPopover.tsxto include Vertex AI section.text-embedding-004,text-multilingual-embedding-002,textembedding-gecko@003,textembedding-gecko-multilingual@001.CodeIndexPopover.tsxto include Vertex AI settings.embeddings.json.VertexEmbedderinvertex.spec.ts.codebaseIndexModelsincodebase-index.ts.This description was created by
for 2f5f55e. You can customize this summary. It will automatically update as commits are pushed.