Skip to main content
AwsBedrockEmbedder defaults to cohere.embed-multilingual-v3 with 1024 dimensions. Set input_type for the text being embedded.
aws_bedrock_embedder.py
AwsBedrockEmbedder applies one configured input_type to every call. A single instance used by a vector database therefore applies the same input type to document insertion and query search. Cohere retrieval models distinguish search_document from search_query.
For Cohere Embed v4, set id="cohere.embed-v4:0". The embedder changes its default vector dimension to 1536. Set output_dimension to use 256, 512, 1024, or 1536 dimensions.

Run the Example

1

Set up your virtual environment

2

Configure AWS credentials

Authenticate with the AWS SDK credential chain, then set the region:
3

Install dependencies

4

Run the example

Developer Resources