This repository contains a Streamlit application that demonstrates the capabilities of Anthropic's Claude Sonnet V3 model via the AWS Bedrock API. The app supports multimodal interactions, allowing users to engage in a conversation with the model using both text and images. The focus of this application is to serve as a feasability demonstration and a possible starting point for others to develop it further/ build on it/improve code quality etc.
- Text-based Interaction: Users can input text questions or statements for the model to respond to.
- Image-based Interaction: Users have the option to upload an image, which the model will consider as part of the conversation context.
- Conversation History: The app maintains a history of the conversation, displaying previous exchanges between the user and the model.
To run this app, follow these steps:
-
Clone the Repository
git clone <repository-url>
-
Install Dependencies
Navigate to the cloned repository's directory and install the required Python packages.
pip install -r requirements.txt
-
Configuration
Create a
secrets.toml
file in the root directory of your project with the following structure:[bedrock] aws_access_key_id = "YourAWSAccessKeyID" aws_secret_access_key = "YourAWSSecretAccessKey" region_name = "YourAWSRegion"
Replace the placeholders with your actual AWS credentials and region.
-
Run the App
Launch the app by running:
streamlit run app.py
Navigate to the URL provided by Streamlit to view the app.
The app uses the AWS Bedrock API to communicate with the Anthropic Claude V3 Sonnet model. Users can input text or upload images, which are then sent to the model as part of the conversation history. The model processes these inputs and generates a response, which is displayed in the app.
The code in app.py
demonstrates how to set up the Streamlit app, handle user inputs, and communicate with the AWS Bedrock API.
- Python 3.8+
- Streamlit
- Boto3
- TOML
- Pillow
Please ensure you have these installed before running the app.
I welcome contributions to improve this demo app. Please feel free to submit pull requests or open issues to suggest enhancements or report bugs.
This project is licensed under the MIT License. See the LICENSE file for more details.