GeminiEmbedder class is used to embed text data into vectors using Google’s Gemini API. You can use it through Google AI Studio or Google Cloud Vertex AI.
Usage
For Google AI Studio:Params
| Parameter | Type | Default | Description |
|---|---|---|---|
id | str | gemini-embedding-exp-03-07 | The Gemini embedding model ID to use |
task_type | str | RETRIEVAL_QUERY | The type of task for which embeddings are being generated |
title | Optional[str] | None | Optional title for the embedding task |
dimensions | Optional[int] | 1536 | The dimensionality of the generated embeddings |
api_key | Optional[str] | None | The API key used for authenticating requests |
request_params | Optional[Dict[str, Any]] | None | Optional dictionary of parameters for the embedding request |
client_params | Optional[Dict[str, Any]] | None | Optional dictionary of parameters for the Gemini client |
gemini_client | Optional[GeminiClient] | None | Optional pre-configured Gemini client instance |
vertexai | bool | False | Whether to use Vertex AI instead of Google AI Studio |
project_id | Optional[str] | None | Google Cloud project ID for Vertex AI |
location | Optional[str] | None | Google Cloud region for Vertex AI |
Developer Resources
- View Cookbook