feat: add Google/Gemini embedding provider support#589
Closed
ZaynJarvis wants to merge 1 commit intovolcengine:mainfrom
Closed
feat: add Google/Gemini embedding provider support#589ZaynJarvis wants to merge 1 commit intovolcengine:mainfrom
ZaynJarvis wants to merge 1 commit intovolcengine:mainfrom
Conversation
Collaborator
Author
|
Closes #566 |
Collaborator
Collaborator
Author
|
close as dups with #607 |
Collaborator
Author
|
open as #607 is reverted and introduce more complexity on multimodal. multimodal will be supported in future. |
- Add GoogleDenseEmbedder with new API pattern - Support query_param/document_param with is_query parameter - Add key=value parsing for multiple parameters - Integrate with embedding config factory - Update imports and __init__.py Usage: - Simple: query_param='RETRIEVAL_QUERY', document_param='RETRIEVAL_DOCUMENT' - Enhanced: query_param='task_type=RETRIEVAL_QUERY,output_dimensionality=1024' Supports Google's OpenAI-compatible endpoint with task_type and Matryoshka dimensions.
1cd3681 to
3b163ae
Compare
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Add Google/Gemini as a new embedding provider, supporting Gemini Embedding 2 (
gemini-embedding-2-preview) model.Changes
openviking/models/embedder/google_embedders.py—GoogleDenseEmbedderusing Gemini's OpenAI-compatible endpointgoogleas a valid provider inembedding_config.pywith factory wiringDesign
generativelanguage.googleapis.com/v1beta/openai/) — no new SDK dependency neededConfiguration Example
{ "embedding": { "dense": { "provider": "google", "api_key": "your-gemini-api-key", "model": "gemini-embedding-2-preview", "dimension": 3072 } } }