Welcome to the Bedrock Examples repository! This repository is aimed to provide you with practical examples of how to interact with the Bedrock API using the boto3
library in Python. Whether you're new to working with AWS services or an experienced developer looking to integrate Bedrock services into your projects, these examples will guide you through.
To effectively use these examples, please ensure you have the following prerequisites set up:
-
Python 3.x: Ensure Python 3.x is installed on your machine. If not, download it from the official website.
-
Boto3 Library: Boto3 is the Amazon Web Services (AWS) SDK for Python, which enables Python developers to write software that uses services like Amazon S3 and Amazon EC2. Install boto3 via pip:
pip install boto3
-
AWS Account and Configuration: You need an AWS account to use this SDK. Additionally, AWS Access Keys must be properly configured to authenticate your requests. Set up your AWS credentials (access key ID and secret access key) and default region by following the Boto3 Quickstart guide.
This repository currently contains a singular example that demonstrates how to call the Anthropic Claude Sonnet API using boto3. However, the repository is intended to be regularly updated with additional examples covering various Bedrock API calls. Here’s what’s inside:
- Anthropic Claude Sonnet API Call: A basic guide on how to send requests to the Anthropic Claude Sonnet model, and how to handle the responses.
Start by cloning this repository to your local machine:
git clone https://github.com/ariveroi/bedrock-examples.git
Navigate to the example you are interested in. Each example is contained within its own directory and includes a README.md that provides detailed instructions on how to execute the example and what results to expect.
Contributions are welcome! If you have an example you'd like to share or suggestions for improving an existing example, please submit a pull request.
This project is licensed under the MIT License - see the LICENSE file for more details.
This repository and its contents are not affiliated with, endorsed by, or sponsored by AWS. It is provided for educational purposes only and not intended for production use.
We hope these examples assist you in navigating the Bedrock API and boto3. Happy coding!