Gemini Embedder is a class that allows you to embed documents using Google’s Gemini embedding models through the Google Generative AI API.

Parameters

ParameterTypeDescriptionDefault
idstrThe model ID to use for embeddings"models/text-embedding-004"
task_typestrType of task for embedding generation"RETRIEVAL_QUERY"
titleOptional[str]Optional title for the content being embeddedNone
dimensionsOptional[int]Output dimensions of the embedding768
api_keyOptional[str]Google API keyEnvironment variable GOOGLE_API_KEY
request_paramsOptional[Dict[str, Any]]Additional parameters for embedding requestsNone
client_paramsOptional[Dict[str, Any]]Additional parameters for client initializationNone
gemini_clientOptional[ModuleType]Pre-configured Gemini clientNone