semantic_router.encoders.bedrock#
This module provides the BedrockEncoder class for generating embeddings using Amazon’s Bedrock Platform.
The BedrockEncoder class is a subclass of BaseEncoder and utilizes the TextEmbeddingModel from the Amazon’s Bedrock Platform to generate embeddings for given documents. It requires an AWS Access Key ID and AWS Secret Access Key and supports customization of the pre-trained model, score threshold, and region.
Example usage:
from semantic_router.encoders.bedrock_encoder import BedrockEncoder
encoder = BedrockEncoder(access_key_id=”your-access-key-id”, secret_access_key=”your-secret-key”, region=”your-region”) embeddings = encoder([“document1”, “document2”])
- Classes:
BedrockEncoder: A class for generating embeddings using the Bedrock Platform.
Classes
|