Skip to content

refactor: Google GenAI embedders - adaptations for Gemini Embedding 2 general availability#3251

Merged
anakin87 merged 4 commits intomainfrom
gemini-embedding-2-updates
Apr 29, 2026
Merged

refactor: Google GenAI embedders - adaptations for Gemini Embedding 2 general availability#3251
anakin87 merged 4 commits intomainfrom
gemini-embedding-2-updates

Conversation

@anakin87
Copy link
Copy Markdown
Member

@anakin87 anakin87 commented Apr 28, 2026

Related Issues

Proposed Changes:

  • change model name
  • task type is ignored in Gemini Embedding 2 and from now on (docs) -> do not set these values by default
  • embedding aggregation changes (docs) -> modify Document Embedder to handle this; Multimodal embedder was already OK

How did you test it?

CI, new tests, tested with this notebook (needs minor updates);
local tests pass, CI is failing due to resource exhausted

Checklist

@github-actions github-actions Bot added the type:documentation Improvements or additions to documentation label Apr 28, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 28, 2026

Coverage report (google_genai)

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  integrations/google_genai/src/haystack_integrations/components/embedders/google_genai
  document_embedder.py 218, 251
  multimodal_document_embedder.py
  text_embedder.py
Project Total  

This report was generated by python-coverage-comment-action

@anakin87 anakin87 marked this pull request as ready for review April 28, 2026 15:47
@anakin87 anakin87 requested a review from a team as a code owner April 28, 2026 15:47
@anakin87 anakin87 requested review from bogdankostic and removed request for a team April 28, 2026 15:47
Comment on lines 104 to 107
:param prefix:
A string to add at the beginning of each text.
:param suffix:
A string to add at the end of each text.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think it would be worth linking these docs https://ai.google.dev/gemini-api/docs/embeddings#task-types-embeddings-2 for suggested prefixes that users could/should set?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done in d9d0464

Copy link
Copy Markdown
Contributor

@sjrl sjrl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor comment otherwise looks good!

@anakin87 anakin87 merged commit ceee0d5 into main Apr 29, 2026
12 of 16 checks passed
@anakin87 anakin87 deleted the gemini-embedding-2-updates branch April 29, 2026 07:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration:google-genai type:documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants