A simple and clear example for implement a chatbot with Bedrock(Claude) + LangChain + Streamlit. Just cd
to the corresponding folder and run the code:
streamlit run bedrock_chatbot.py
The bot is equipped with chat history using ConversationBufferWindowMemory and StreamlitChatMessageHistory, and provided with both simple(batch) and streaming modes. Demo shown as below:
Bedrock_Chat_Fast.mp4
Streaming mode demo shown as below:
Bedrock_Chat_Streaming_Fast.mp4
- Copy the
.env_aws.example
file to a new file named.env_aws
. - Replace the placeholder values in
.env_aws
with your actual AWS credentials. - Note: Do not commit the
.env_aws
file to the repository. It is included in the.gitignore
file to prevent sensitive information from being exposed.
docker compose up