GoogleEncoder Objects
client
- An instance of the TextEmbeddingModel client.type
- The type of the encoder, which is “google”.
__init__
model_name
(str
): The name of the pre-trained model to use for embedding. If not provided, the default model specified in EncoderDefault will be used.score_threshold
(float
): The threshold for similarity scores.project_id
(str
): The Google Cloud project ID. If not provided, it will be retrieved from the GOOGLE_PROJECT_ID environment variable.location
(str
): The location of the AI Platform resources. If not provided, it will be retrieved from the GOOGLE_LOCATION environment variable, defaulting to “us-central1”.api_endpoint
(str
): The API endpoint for the AI Platform. If not provided, it will be retrieved from the GOOGLE_API_ENDPOINT environment variable.
str
0: If the Google Project ID is not provided or if the AI Platform client fails to initialize.
__call__
docs
(List[str]
): A list of strings representing the documents to embed.
ValueError
: If the Google AI Platform client is not initialized or if the API call fails.
List[List[float]]
: A list of lists, where each inner list contains the embedding values for a
document.