Skip to content
This repository was archived by the owner on May 10, 2024. It is now read-only.

Commit 01b1dc6

Browse files
committed
feat: Amazon Bedrock Embedding doc
1 parent ac84d29 commit 01b1dc6

File tree

3 files changed

+31
-0
lines changed

3 files changed

+31
-0
lines changed

docs/embeddings.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Chroma provides lightweight wrappers around popular embedding providers, making
2020
| [Instructor](/embeddings/instructor) |||
2121
| [Hugging Face Embedding Server](/embeddings/hugging-face-embedding-server) |||
2222
| [Jina AI](/embeddings/jinaai) |||
23+
| [Amazon Bedrock](/embeddings/amazon-bedrock) |||
2324

2425
We welcome pull requests to add new Embedding Functions to the community.
2526

docs/embeddings/amazon-bedrock.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
---
3+
4+
# Amazon Bedrock
5+
6+
Chroma provides a convinient wrapper for [Amazon Bedrock](https://aws.amazon.com/bedrock/) embedding API. This embedding function runs remotely on Amazon's servers, and requires an Amazon client session.
7+
8+
To use Amazon Bedrock embedding API, you must have `boto3` Python package installed and create an instance of `boto3.Session` with your AWS credentials. To use:
9+
10+
```python
11+
import boto3
12+
import chromadb.utils.embedding_functions as embedding_functions
13+
14+
session = boto3.Session(
15+
aws_access_key_id=aws_access_key_id,
16+
aws_secret_access_key=aws_secret_access_key,
17+
region_name=region_name,
18+
)
19+
bedrock = embedding_functions.AmazonBedrockEmbeddingFunction(session=session)
20+
bedrock(["document1","document2"])
21+
```
22+
23+
By default, the embedding function uses the `amazon.titan-embed-text-v1` for the model, but you can specify a different model name with `model_name` parameter. For example:
24+
25+
```python
26+
bedrock = embedding_functions.AmazonBedrockEmbeddingFunction(
27+
session=session, model_name="cohere.embed-multilingual-v3")
28+
bedrock(["こんにちは", "你们好"])
29+
```

sidebars.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ const sidebars = {
9393
'embeddings/instructor',
9494
'embeddings/hugging-face-embedding-server',
9595
'embeddings/jinaai',
96+
'embeddings/amazon-bedrock',
9697
],
9798
},
9899
],

0 commit comments

Comments
 (0)