A ChatGPT dialogue assistant built with Streamlit, easy to use, stable, supporting the following features:
- Multiple chat windows
- History of conversations retained
- Pre-set chat context
- Model parameter adjustment
- Export conversations as Markdown files
- ChatGPT voice interaction (Edge browser on PC recommended)
- Directly use the deployed project, you can configure the Openai Key in the web page's settings option. In this case, the history of conversations will not be retained and is only valid during the user's current session, not shared with others.
- If deploying the project yourself, after configuring the Openai Key in Secrets, the history of conversations will be retained. In this case, it needs to be set as a private application to build a personal GPT assistant.
- Double-click the page to directly locate the input bar
- Ctrl + Enter to quickly submit questions
Easy and free deployment, usable without the need for bypassing geo-restrictions, note to set as a private application. Refer to the detailed steps provided by @Hannah11111.
Fork
this project to your personal Github repository.- Register for a Streamlit Cloud account, and connect to Github.
- Start deploying the application, refer to the official tutorial.
- Configure the Openai Key in the application's Secrets, see the following figure for the format:
-
Create a virtual environment (recommended)
-
Clone the project (or manually download it to local)
git clone https://github.com/PierXuY/ChatGPT-Assistant.git
- Install dependencies
pip install -r requirements.txt
- Set API Key; Set API Base (optional)
- Write
apikey = "Openai Key" in
.streamlit/secrets.toml` file. - Science-free use can be achieved by writing the proxy interface in the
.streamlit/secrets.toml
file in the formatapibase = "Proxy Interface Address"
, as described below:- You can directly use the proxy interface already built by the project openai-forward, i.e. `apibase = "https://api.openai-forward.com/ v1".
- You can refer to the openai-forward project to build the proxy interface and set it up by yourself.
- Start the application
streamlit run app.py
- Customizable username and SVG-formatted avatar in custom.py file [(source)](https://www.dicebear. com/playground?style=identicon).
- Edit set_context.py in the deployed project's source code to add the predefined context options, which will be automatically synchronized to the application.
- If you are in a position to do so, you can consider changing the file read/write logic in helper.py to a cloud database operation to prevent history loss.
- The earliest modification was based on the shan-mx/ChatGPT_Streamlit project, thanks.
- The preset context function is referenced from [binary-husky/chatgpt_academic](https:// github.com/binary-husky/chatgpt_academic) project and f/awesome-chatgpt-prompts project, with thanks.
- The voice interaction features refer to the projects talk-to-chatgpt and [Voice Control for ChatGPT](https://chrome.google.com/ webstore/detail/voice-control-for-chatgpt/eollffkcakegifhacjnlnegohfdlidhn) for the implementation, with thanks.