cookbook/90_models/aws/bedrock/README.md
Note: Fork and clone this repository if needed
python3 -m venv ~/.venvs/aienv
source ~/.venvs/aienv/bin/activate
export AWS_ACCESS_KEY_ID=***
export AWS_SECRET_ACCESS_KEY=***
export AWS_REGION=***
Alternatively, you can use an AWS profile:
import boto3
session = boto3.Session(profile_name='MY-PROFILE')
agent = Agent(
model=AwsBedrock(id="mistral.mistral-small-2402-v1:0", session=session),
markdown=True
)
Log in through the aws sso login command to get access to your account
aws sso login
Leverage sso settings in the AwsBedrock object to leverage the credentials provided by sso
import boto3
agent = Agent(
model=AwsBedrock(id="mistral.mistral-small-2402-v1:0", aws_sso_auth= True),
markdown=True
)
uv pip install -U boto3 ddgs agno
python cookbook/92_models/aws/bedrock/basic_stream.py
python cookbook/92_models/aws/bedrock/basic.py
python cookbook/92_models/aws/bedrock/tool_use.py
python cookbook/92_models/aws/bedrock/structured_output.py
python cookbook/92_models/aws/bedrock/storage.py
python cookbook/92_models/aws/bedrock/knowledge.py