Chat sample code between users using Streamlit.
This project will be the code to chat between users by Streamlit. Since it is the minimum necessary content, please modify it as necessary and use it.
Demo is as follows.
pip install -r build/requirements.txt
If you want to run with Docker, please build the image with the following command.
docker build -t streamlit_chat_app_demo build
docker run -it --rm -p 8501:8501 -v $PWD:/home/workspace --name streamlit_chat_app_demo streamlit_chat_app_demo bash
The setting value of this code can be changed from the following setting file.
You can configure the following settings.
streamlit run src/01_login.py
If successful, the following log will be output.
You can now view your Streamlit app in your browser.
Local URL: http://localhost:8501
Network URL: http://xxxx.xxxx.xxxx.xxxx:8501
During execution, you can check the demo screen from the following page.
http://localhost:8501
User registered successfully. Please login to continue.
Welcome [user name].
Procedure if you want to add a character by ChatGPT to chat.
export OPENAI_API_KEY="YOUR_API_KEY"
streamlit run src/01_login.py -- --use_chatbot
It’s basically the same as normal chat, but you can set your character’s personality from the “set character” page.
When you send a message in chat, the character will reply.