This repository contains code samples for building diverse AI applications using Amazon Bedrock's foundation models. Learn how to accelerate projects in image and text generation and beyond.
To get a local copy up and running, follow these simple steps.
- Python 3.9 or higher
- pip
- Model Access in Amazon Bedrock
Clone the repo
git clone https://github.com/build-on-aws/amazon-bedrock-quick-start.git
Install required packages
pip install -r requirements.txt
This repository contains various code samples demonstrating how to build AI applications using Amazon Bedrock's foundation models. Here's how to use each:
To generate images using Stable Diffusion, run the following command:
streamlit run sd_sample_st.py
This will launch a Streamlit app where you can enter text prompts to generate corresponding images.
Run this Python script to see different text-based applications like text summarization, code generation, and Q&A:
python text_examples.py
This script will output results for each of these applications, showcasing the versatility of foundation models in text-based tasks.
To interact with a chatbot built using Amazon Bedrock, LangChain, and Streamlit, run:
streamlit run chat_bedrock_st.py
This launches a Streamlit app where you can have a conversation with the chatbot, witnessing AI-powered conversational capabilities firsthand.
To see how Retrieval Augmented Generation (RAG) works with LangChain, execute:
python rag_example.py
This will demonstrate how RAG augments foundation models by retrieving and incorporating external data into the generated content.
See CONTRIBUTING for more information.
This library is licensed under the MIT-0 License. See the LICENSE file.