Skip to content

Commit af40cc6

Browse files
speedstorm1copybara-github
authored andcommitted
feat: Support multimodal embedding for Gemini Embedding 2.0 and support MaaS models in Models.embed_content() (Vertex AI API)
PiperOrigin-RevId: 869462817
1 parent 9a9908a commit af40cc6

File tree

6 files changed

+496
-84
lines changed

6 files changed

+496
-84
lines changed

google/genai/_transformers.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1348,3 +1348,12 @@ def t_metrics(
13481348
)
13491349
metrics_payload.append(metric_payload_item)
13501350
return metrics_payload
1351+
1352+
1353+
def t_is_vertex_embed_content_model(model: str) -> bool:
1354+
return (
1355+
# Gemini Embeddings except gemini-embedding-001.
1356+
'gemini' in model and model != 'gemini-embedding-001'
1357+
# Open-source MaaS embedding models.
1358+
or 'maas' in model
1359+
)

0 commit comments

Comments
 (0)