Gemini
Parameters for GeminiEmbedder, which embeds documents with Gemini embedding models via the Gemini API or Vertex AI.
Gemini Embedder embeds documents using Google's Gemini embedding models through the Gemini API or Vertex AI.
Parameters
| Parameter | Type | Description | Default |
|---|---|---|---|
id | str | The model ID to use for embeddings | "gemini-embedding-001" |
task_type | str | Type of task for embedding generation | "RETRIEVAL_QUERY" |
title | Optional[str] | Optional title for the content being embedded | None |
dimensions | Optional[int] | Output dimensions of the embedding | 1536 |
api_key | Optional[str] | Google API key | Environment variable GOOGLE_API_KEY |
request_params | Optional[Dict[str, Any]] | Additional parameters for embedding requests | None |
client_params | Optional[Dict[str, Any]] | Additional parameters for client initialization | None |
gemini_client | Optional[Client] | Pre-configured google.genai client | None |
vertexai | bool | Use the Vertex AI API. Also enabled by setting GOOGLE_GENAI_USE_VERTEXAI=true | False |
project_id | Optional[str] | Google Cloud project ID for Vertex AI. Falls back to GOOGLE_CLOUD_PROJECT | None |
location | Optional[str] | Google Cloud region for Vertex AI. Falls back to GOOGLE_CLOUD_LOCATION | None |
enable_batch | bool | Embed multiple texts per API call when adding content to vector databases | False |
batch_size | int | Number of texts per batch when enable_batch is True | 100 |