Add image embedding to the Cohere vectorizer (Embed v4 and v5)
Maintainer thường phản hồi trong vòng 4 ngày
@rahulsjha đang làm issue này rồi.
Từ ngày 3/12/2026.
Đá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
- 58/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- python
- Lĩnh vực
- machine-learning
Hướng nghiên cứu
Start with redisvl/utils/vectorize/text/cohere.py, the vectorizer_from_dict mapping, and the existing VoyageAI deprecated alias pattern. Check the v2 Cohere client version and the v4 request shape, then add sync and async coverage for text, image, and supported multimodal inputs. Done means the stated unit and API tests pass and the API reference and vectorizers guide describe the new behavior.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
Add image input for Cohere Embed v4.0 and v5. Follow the pattern from #452: a new CohereVectorizer that takes text and images, with CohereTextVectorizer kept as a deprecated alias. Once #885 merges, also accept MultimodalInput, since Cohere merges text and image parts in one input into one vector.
Depends on #885 for the MultimodalInput part.
Current state
CohereTextVectorizer(redisvl/utils/vectorize/text/cohere.py) uses the v1cohere.Clientand callsembed(texts=...). It is text-only.vectorizer_from_dictmapsVectorizers.coheretoCohereTextVectorizer.- The extra pins
cohere>=4.44.
Provider facts (Cohere docs, 2026-12-02)
embed(inputs=[{"content": [parts...]}], model=..., input_type=..., embedding_types=[...], output_dimension=...). Each part is either{"type": "text", "text": ...}or{"type": "image_url", "image_url": {"url": <base64 data URL>}}. Each entry ininputsgives one vector.- The docs show this request shape for
embed-v5.0-pro. Forembed-v4.0they list "mixed texts/images" as a supported modality but give no request example, so check v4.0 during implementation. input_typemust besearch_query,search_document,classificationorclustering.- Images: PNG, JPEG, WEBP or GIF, with a 20 MB payload cap. Cohere resizes images that are too large or too small.
- Dimensions:
embed-v4.0: 256, 512, 1024, or 1536 (default);embed-v5.0-pro/-fast: 256 up to 2048, with 2048 the default.
Design
- New class:
CohereVectorizerinredisvl/utils/vectorize/cohere.py. It uses the v2 client (ClientV2/AsyncClientV2) and theinputs=request shape for every item, text included, so there is one code path.CohereTextVectorizerbecomes a@deprecated_classsubclass, asVoyageAITextVectorizerdid.vectorizer_from_dictmapsVectorizers.cohereto the new class.- Raise the
coherefloor to the first release withClientV2. Check which version that is.
- Accepted items:
str,PIL.Image.Image, andPathto an image, encoded as a base64 data URL. Add anembed_image(path)helper. - Model capability: image and
MultimodalInputitems requireembed-v4.0or anembed-v5.0-*model. Older models raiseTypeErrorbefore the API call. v3 image embedding goes through a different parameter and is out of scope. - Dimensions: add an
output_dimensionconstructor argument. It setsdimsand is fixed for the vectorizer's lifetime, likeGoogleGenAIVectorizer.output_dimensionality. - Unchanged behaviour:
input_typestays required, anddtypestill maps toembedding_types. - Interleaved input (with #885): a
MultimodalInputbecomes oneinputsentry with one part per element.
Out of scope
- Image input on v3 models.
- PDF input.
Definition of done
- Text and image embedding work on
embed-v4.0andembed-v5.0-*, sync and async, as single items and insideembed_many. CohereTextVectorizerstill works and warns. Existing text results are unchanged for the same model andinput_type.- After #885,
MultimodalInputreturns one vector on the supported models. - Unit tests: the request shape sent to a mocked v2 client, rejection by model capability, and the deprecated alias.
- Integration tests marked as API tests.
- Docs: the API reference and the vectorizers guide.
References
- 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
-
Độ 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
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 52/100
redis/redis-vl-python#885 ·
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