Optional
fields: BedrockEmbeddingsParamsA client provided by the user that allows them to customze any SDK configuration options.
Optional
clientOverrideable configuration options for the BedrockRuntimeClient. Allows customization of client configuration such as requestHandler, etc. Will be ignored if 'client' is provided.
Model Name to use. Defaults to amazon.titan-embed-text-v1
if not provided
Protected
_Protected method to make a request to the Bedrock API to generate embeddings. Handles the retry logic and returns the response from the API.
Promise that resolves to the response from the API.
Method to generate embeddings for an array of texts. Calls _embedText method which batches and handles retry logic when calling the AWS Bedrock API.
Array of texts for which to generate embeddings.
Promise that resolves to a 2D array of embeddings for each input document.
Method that takes a document as input and returns a promise that resolves to an embedding for the document. It calls the _embedText method with the document as the input.
Document for which to generate an embedding.
Promise that resolves to an embedding for the input document.
Class that extends the Embeddings class and provides methods for generating embeddings using the Bedrock API.
Example