mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-11 00:58:30 +00:00
updating bedrock docs
This commit is contained in:
@@ -434,6 +434,38 @@ my_crew = Crew(
|
|||||||
)
|
)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Using Amazon Bedrock embeddings
|
||||||
|
|
||||||
|
```python Code
|
||||||
|
# Note: Ensure you have installed `boto3` for Bedrock embeddings to work.
|
||||||
|
|
||||||
|
import os
|
||||||
|
import boto3
|
||||||
|
from crewai import Crew, Agent, Task, Process
|
||||||
|
|
||||||
|
boto3_session = boto3.Session(
|
||||||
|
region_name=os.environ.get("AWS_REGION_NAME"),
|
||||||
|
aws_access_key_id=os.environ.get("AWS_ACCESS_KEY_ID"),
|
||||||
|
aws_secret_access_key=os.environ.get("AWS_SECRET_ACCESS_KEY")
|
||||||
|
)
|
||||||
|
|
||||||
|
my_crew = Crew(
|
||||||
|
agents=[...],
|
||||||
|
tasks=[...],
|
||||||
|
process=Process.sequential,
|
||||||
|
memory=True,
|
||||||
|
embedder={
|
||||||
|
"provider": "bedrock",
|
||||||
|
"config":{
|
||||||
|
"session": boto3_session,
|
||||||
|
"model": "amazon.titan-embed-text-v2:0",
|
||||||
|
"vector_dimension": 1024
|
||||||
|
}
|
||||||
|
}
|
||||||
|
verbose=True
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
### Adding Custom Embedding Function
|
### Adding Custom Embedding Function
|
||||||
|
|
||||||
```python Code
|
```python Code
|
||||||
|
|||||||
Reference in New Issue
Block a user