Skip to content

Multimodal embedding via genai SDK fails #1975

@Attila-Roomr

Description

@Attila-Roomr

Using Python:
We are migrating to the google-genai SDK (v1.x) and targeting the multimodalembedding model on Vertex AI. The SDK's models.embed_content method incorrectly wraps inputs in the Gemini contents/parts schema, which the legacy multimodalembedding backend rejects with 400 Empty instances. This persists regardless of whether we use types.Part, types.Content, or raw dictionaries as inputs.
I've tried all the solutions that Gemini was able to suggest, they all failed for various reasons, but most notably the Empty instance was the most recurring one.

The vertex ai SDK works perfectly, but we were asked to migrate our 1408 multimodal embedding code.

Metadata

Metadata

Assignees

Labels

priority: p2Moderately-important priority. Fix may not be included in next release.status:awaiting user responsetype: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions