semantic_router.encoders.google#

This module provides the GoogleEncoder class for generating embeddings using Google’s AI Platform.

The GoogleEncoder class is a subclass of BaseEncoder and utilizes the TextEmbeddingModel from the Google AI Platform to generate embeddings for given documents. It requires a Google Cloud project ID and supports customization of the pre-trained model, score threshold, location, and API endpoint.

Example usage:

from semantic_router.encoders.google_encoder import GoogleEncoder

encoder = GoogleEncoder(project_id=”your-project-id”) embeddings = encoder([“document1”, “document2”])

Classes:

GoogleEncoder: A class for generating embeddings using Google’s AI Platform.

Classes

GoogleEncoder([name, score_threshold, ...])

GoogleEncoder class for generating embeddings using Google's AI Platform.