Skip to content

feat(genai/embeddings/multimodal): Add genai multimodal embedding image sample - #14511

Draft
Kef131 wants to merge 2 commits into
mainfrom
feat(embeddings/multimodal)_add_sample_multimodal_embedding_image
Draft

feat(genai/embeddings/multimodal): Add genai multimodal embedding image sample #14511
Kef131 wants to merge 2 commits into
mainfrom
feat(embeddings/multimodal)_add_sample_multimodal_embedding_image

Conversation

@Kef131

@Kef131 Kef131 commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes #
b/546136656

Add new example for generating multimodal image embeddings using the Gemini API and corresponding test to the test

  • Added multimodal_embedding_image.py implementing an example of embedding image and text content using the Gemini embedding model (gemini-embedding-2).
  • Changed the default GOOGLE_CLOUD_LOCATION for tests from us-central1 to global for broader compatibility.

Checklist

Testing

  • I have tested this change on a live environment and verified it works as intended.

Compliance & Style


Post-Approval Actions

  • Please merge this PR for me once it is approved
image image

@Kef131
Kef131 requested review from a team as code owners August 14, 2026 21:14
@snippet-bot

snippet-bot Bot commented Aug 14, 2026

Copy link
Copy Markdown

Here is the summary of changes.

You are about to add 1 region tag.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

@product-auto-label product-auto-label Bot added the samples Issues that are directly related to samples. label Aug 14, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

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.

Code Review

This pull request adds a new example and test for generating multimodal embeddings from an image and text using the Google GenAI SDK. The review feedback correctly identifies three key issues: an incorrect model name ('gemini-embedding-2' instead of 'multimodal-embedding-001'), an invalid regional location setting ('global' instead of 'us-central1') in the test environment, and an overly generic return type hint ('object' instead of 'types.EmbedContentResponse') in the new module.

Comment thread genai/embeddings/multimodal_embedding_image.py
Comment thread genai/embeddings/test_embeddings_examples.py
Comment thread genai/embeddings/multimodal_embedding_image.py Outdated
@Kef131 Kef131 changed the title feat(embeddings/multimodal): Add multimodal embedding image example feat(genai/embeddings/multimodal): Add genai multimodal embedding image sample Aug 14, 2026
@Kef131
Kef131 marked this pull request as draft August 14, 2026 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

samples Issues that are directly related to samples.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant