Support interleaved text and image input in VoyageAIVectorizer
Maintainer thường phản hồi trong vòng 4 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 52/100
Hướng nghiên cứu
Start with redisvl/utils/vectorize/base.py for input validation, cache serialization, and sync/async entry points, then read redisvl/utils/vectorize/voyageai.py for Voyage request construction. Check the existing vectorizer tests and add coverage for validation, cache key ordering, request shape, unsupported models, and sync/async embedding; the issue also names docs/user_guide/04_vectorizers.ipynb and docs/api/vectorizer.rst. Done means the wrapper is exported, supported Voyage models produce one vector per mixed input, and the documented tests and examples are covered.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
Add a way to embed one input made of ordered text and image parts and get one vector for it. This is the request left open by #260. #452 added image and video embedding, one modality per input.
The first implementation targets VoyageAIVectorizer. The input type and the base-class plumbing are general, so other vectorizers can opt in later.
Current state
embed()andembed_many()treat every item as one modality (str,PIL.Image.Image,Pathor VoyageVideo), and each item gets its own vector.VoyageAIVectorizer._embed_manywraps every item as a single-part input,[[item] for item in batch](redisvl/utils/vectorize/voyageai.py:486-492). Voyage'smultimodal_embedaccepts several parts per input, but RedisVL has no way to pass them.BaseVectorizer._serialize_for_cache(base.py:581) handles only single items.
Provider landscape
Checked against provider documentation on 2026-12-02.
| Provider / model | One vector for mixed text and image input? |
|---|---|
Voyage voyage-multimodal-3.5 |
Yes. Each entry in inputs is an ordered list of parts, and the docs call this interleaved. The limit is 32,000 tokens per input, with images counted by pixel area. |
Google gemini-embedding-2 |
Yes. Several parts in one contents are aggregated into one vector. Up to 6 images and 8,192 tokens per request. GoogleGenAIVectorizer is text-only today. |
Cohere embed-v5.0-pro / Embed v4.0 |
Yes for v5, shown in the docs (inputs=[{"content": [...parts]}]). v4.0 is listed as supporting mixed input, but the docs show no request example for it. CohereTextVectorizer is text-only today. |
| Amazon Titan Multimodal G1 | One vector, but it is the average of separately computed text and image embeddings, not a joint encoding. One image and 256 text tokens per request. |
| Amazon Nova Multimodal Embeddings | No. Exactly one modality per request. |
OpenAI text-embedding-3-* |
No. Text only. |
Design
Input type
Add a public, immutable wrapper, exported from redisvl.utils.vectorize:
MultimodalInput(parts=["A ripe banana", Image.open("banana.jpg")])
partsis an ordered, non-empty sequence ofstrandPIL.Image.Image. Empty strings, nestedMultimodalInputvalues and any other type raiseTypeErrorat construction.- Part order is meaningful. It changes the embedding and the cache key.
- A
MultimodalInputis a single item. It goes wherever one item goes today:embed(content=...),aembed(), and as an element ofembed_many()/aembed_many(), mixed freely with plain items.
vec = vz.embed(MultimodalInput(["A ripe banana", Image.open("banana.jpg")]))
vecs = vz.embed_many([
MultimodalInput(["caption", img1]),
"plain text",
img2,
])
Vectorizer support
BaseVectorizergains a capability flag, for example asupports_multimodal_inputproperty that isFalseby default.embed,embed_manyand their async forms check it before the cache lookup and the provider call. An unsupported vectorizer raises aTypeErrornaming the vectorizer and the model.VoyageAIVectorizerreturnsTruewhenis_multimodal, andFalsefor text and contextualised models.- In
_embed_many/_aembed_many, aMultimodalInputis sent aslist(item.parts)and a plain item keeps being sent as[item], so the request shape for existing calls does not change._validate_inputacceptsMultimodalInputitems. - Batching stays item-count based for multimodal models, as it is today.
Cache key
_serialize_for_cache serialises a MultimodalInput to deterministic bytes. The bytes start with a format marker, then each part as a type tag, a length and its payload (UTF-8 for text, PNG bytes for images, matching the existing image handling). The same parts in the same order give the same key, and reordered parts give a different key.
preprocess
preprocess is still applied to the item passed in, so it receives the MultimodalInput as a whole. No per-part hook.
Out of scope
- Video, audio and PDF parts. Voyage
Videostays supported as a plain item, but not inside aMultimodalInput. - Mixed input for Gemini, Cohere and Bedrock. The capability flag is the extension point for them.
- Titan Multimodal G1. Its averaged vector isn't the joint encoding this feature describes.
- Client-side token or image limits. Provider errors keep surfacing as they do today.
- Any change to how existing single items are embedded or cached.
Definition of done
MultimodalInputis exported fromredisvl.utils.vectorize, with validation as described.VoyageAIVectorizerreturns one vector perMultimodalInput, sync and async, alone or mixed with plain items inembed_many.- Unsupported vectorizers raise a clear
TypeErrorbefore any cache or provider call. - Unit tests cover:
MultimodalInputvalidation;- cache-key determinism and order sensitivity;
- the request shape sent to a mocked Voyage client, for a
MultimodalInputand for a plain item side by side; - the unsupported-vectorizer error.
- An integration test against
voyage-multimodal-3.5, marked to run only with API tests. - Docs: a mixed-input example in the vectorizers guide (
docs/user_guide/04_vectorizers.ipynb, marked# NBVAL_SKIPbecause it calls the API) and in thedocs/api/vectorizer.rstreference.
References
- Voyage: https://docs.voyageai.com/docs/multimodal-embeddings
- Gemini: https://aistudio.google.com/docs/embeddings
- Cohere: https://docs.cohere.com/docs/embeddings
- Titan Multimodal G1: https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters-titan-embed-mm.html
- Nova: https://docs.aws.amazon.com/nova/latest/userguide/embeddings-schema.html
- OpenAI: https://developers.openai.com/api/reference/resources/embeddings/methods/create
- Ngôn ngữ chính
- Python
- Star
- 435
- Fork
- 123
- Merge trung bình
- 8 ngày 1 giờ
- Pull request đã merge (30 ngày)
- 39
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của redis/redis-vl-python
-
SearchIndex.drop_keys does not validate cluster hash-tag co-location (inconsistent with drop_documents)Có thể đã có người làm @Hashim1999164 đã nhận 47 ngày trước. Đang mởbug good first issue index
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
redis/redis-vl-python#601 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 4 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
redis/redis-vl-python#889 ·
Maintainer thường phản hồi trong vòng 4 ngày
-
Add image embedding to the Cohere vectorizer (Embed v4 and v5)Có thể đã có người làm @rahulsjha đã nhận 1 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 58/100
redis/redis-vl-python#888 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 4 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 38/100
redis/redis-vl-python#887 ·
Maintainer thường phản hồi trong vòng 4 ngày
-
GoogleGenAIVectorizer.embed_many fails on gemini-embedding-2 for batches of more than one inputCó thể đã có người làm @pcbeingused33 đã nhận 2 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 25/100
redis/redis-vl-python#886 ·
Maintainer thường phản hồi trong vòng 4 ngày
Tất cả issue của redis/redis-vl-python
Issue tương tự
-
[Resource]: SpaicelyĐang mởresource-submission validation-passed
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 68/100
hesreallyhim/awesome-claude-code#3875 · 1 bình luận ·
-
[Bug]: Ajax Pro login issueĐang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
bvis/aegis-hass#725 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
datasektionen/cashflow#468 ·
-
dont call alembic upgrade until we check whether or not the cache DB has an alembic version stampĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Bug: AttributeError: 'GptOssConfig' object has no attribute 'rope_scaling_factor' with transformers >= 5.xCó thể đã có người làm @NimaVaziri đã nhận hôm nay. Đang mởPytorch
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
NVIDIA/TensorRT-LLM#23406 ·
Maintainer thường phản hồi trong vòng 1 ngày