Add image and video embedding to GoogleGenAIVectorizer with gemini-embedding-2
I maintainer di solito rispondono entro 4 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 38/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- google-cloud, python
- Ambito
- machine-learning
Direzione di ricerca
Read the GoogleGenAIVectorizer implementation, its tests, docs/api/vectorizer.rst, and the vectorizers guide; compare the existing VertexAIVectorizer helpers and the fix for #886. Start by checking how the Gemini and Vertex clients build embedding requests, then cover image, video, Part, caching, model capability, and the task type warning in sync and async paths. Done means both backends meet the listed unit and API test requirements and the migration docs point to GoogleGenAIVectorizer.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
Give GoogleGenAIVectorizer image and video input on gemini-embedding-2, on both the Gemini API and Vertex AI backends. This makes it the replacement for the multimodal path of the deprecated VertexAIVectorizer. Once #885 merges, also accept MultimodalInput, since gemini-embedding-2 turns several parts into one vector.
Depends on #885 for the MultimodalInput part and builds on the fix for #886. The single-modality work does not depend on #885.
Current state
GoogleGenAIVectorizeris text-only._validate_manyrejects anything butstr.embed_manyongemini-embedding-2fails for batches of more than one input (#886), because a list of strings incontentsis merged into one vector.- The only image and video route to Google models is
VertexAIVectorizerwithmultimodalembedding@001. It uses the deprecatedvertexai.vision_modelsSDK, which Google scheduled for removal in June 2026.pyproject.tomlkeepsgoogle-cloud-aiplatformpinned because that multimodal path "has no google-genai replacement yet". - The
docs/api/vectorizer.rstnote forVertexAIVectorizersays the multimodal migration is tracked in #620. #620 is closed, and the migration it delivered was text-only.
Provider facts
From Google's docs, checked 2026-12-02:
- Each part is text, or inline image or video bytes with a MIME type. Several parts in one
Contentgive one vector, and oneContentper input gives one vector per input. - Limits are per request:
- 8,192 tokens in total, silently truncated beyond that;
- 6 images (JPEG, PNG, WebP, BMP, HEIC, HEIF, AVIF);
- 1 video (MP4 or MOV, up to 120 s / 120 frames).
- The docs say
task_typeis not supported ongemini-embedding-2and that task instructions belong in the text. - Dimensions: 3072 by default, and
output_dimensionalityaccepts 128 to 3072.
Measured on the Gemini API on 2026-12-02 with google-genai 1.75.0:
- One
Contentholding a text part and an image part gives 1 vector, and twoContentobjects give 2. gemini-embedding-2acceptstask_type=RETRIEVAL_QUERYwithout an error. Its effect is unknown.
Design
- Accepted items:
str,PIL.Image.Image,Pathto an image, andgoogle.genai.types.Partas a passthrough for anything else the SDK supports. Addembed_image(path)andembed_video(path)helpers with the same names and behaviour asVertexAIVectorizerandVoyageAIVectorizer. - Request shape: one
types.Contentper item, as in the fix for #886. With #885, aMultimodalInputbecomes oneContentwith one part per element. - Model capability: image, video and
MultimodalInputitems need a multimodal model. For now that is a model name starting withgemini-embedding-2. Other models raiseTypeErrorbefore any API call. task_type: iftask_typeis set withgemini-embedding-2, log a warning that the docs say it has no effect on this model and that instructions belong in the text. Do not raise, because the API accepts it.- Cache key: extend
_serialize_for_cachetoPartobjects (MIME type plus bytes) and video bytes. - Docs: point the
VertexAIVectorizerdeprecation note atGoogleGenAIVectorizerfor multimodal use.
Out of scope
- Audio and PDF parts.
- Removing
VertexAIVectorizeror thegoogle-cloud-aiplatformpin. - Video longer than the per-request limit (no client-side chunking).
Definition of done
- Images and videos embed on
gemini-embedding-2through both backends, sync and async, as single items and insideembed_many. - After #885,
MultimodalInputreturns one vector, andsupports_multimodal_inputisTrueonly for multimodal models. - Unit tests:
- the request shape sent to a mocked client for image, video and
Partitems; - rejection by model capability;
- the
task_typewarning; - cache keys for
Partand video items.
- the request shape sent to a mocked client for image, video and
- Integration tests marked as API tests.
- Docs updated in
docs/api/vectorizer.rstand the vectorizers guide.
References
- Lingua principale
- Python
- Stelle
- 435
- Fork
- 123
- Merge medio
- 8g 1h
- PR unite (30g)
- 39
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di redis/redis-vl-python
-
SearchIndex.drop_keys does not validate cluster hash-tag co-location (inconsistent with drop_documents)Forse già presa @Hashim1999164 l’ha presa 47 giorni fa. Apertabug good first issue index
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
redis/redis-vl-python#601 · 2 commenti ·
I maintainer di solito rispondono entro 4 giorni
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
redis/redis-vl-python#889 ·
I maintainer di solito rispondono entro 4 giorni
-
Add image embedding to the Cohere vectorizer (Embed v4 and v5)Forse già presa @rahulsjha l’ha presa 1 giorno fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 58/100
redis/redis-vl-python#888 · 2 commenti ·
I maintainer di solito rispondono entro 4 giorni
-
GoogleGenAIVectorizer.embed_many fails on gemini-embedding-2 for batches of more than one inputForse già presa @pcbeingused33 l’ha presa 2 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 25/100
redis/redis-vl-python#886 ·
I maintainer di solito rispondono entro 4 giorni
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
redis/redis-vl-python#885 ·
I maintainer di solito rispondono entro 4 giorni
Tutte le issue di redis/redis-vl-python
Issue simili
-
[Resource]: SpaicelyApertaresource-submission validation-passed
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 68/100
hesreallyhim/awesome-claude-code#3875 · 1 commento ·
-
[Bug]: Ajax Pro login issueApertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
bvis/aegis-hass#725 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
datasektionen/cashflow#468 ·
-
dont call alembic upgrade until we check whether or not the cache DB has an alembic version stampAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
Bug: AttributeError: 'GptOssConfig' object has no attribute 'rope_scaling_factor' with transformers >= 5.xForse già presa @NimaVaziri l’ha presa oggi. ApertaPytorch
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
NVIDIA/TensorRT-LLM#23406 ·
I maintainer di solito rispondono entro 1 giorno