OpenAI Convenient ChatBOT

Avatar of 莊孝穎 (Pikas).
Avatar of 莊孝穎 (Pikas).

OpenAI Convenient ChatBOT

AI Engineer / Artist
Taipei City, Taiwan

OpenAI Convenient ChatBOT

This project is a Colab notebook that integrates with the ChatGPT-3.5 API to act as a chatBOT, which is not only convenient but also useful. The notebook includes built-in keywords in both English and Chinese that you can select to start a chat quickly. Chat records will be saved in "docx" format and stored in your Google Drive folder, which makes it easier to read when not login in. If there're existing chat records in the folder, they'll be listed for you to choose and continue the conversation seamlessly. And what's more, you can even send your chat records toward friends to read or to continue your conversation seamlessly.


(Visit my Github to get more info.)

Preparation

To use this project, please copy your ChatGPT API key first. Otherwise, you need a Google account to access your Google Drive, along with one (or more) ChatGPT-3.5 API keys stored row by row in a txt named "ChatGPT_API_keys.txt" in any folder of your Google Drive.

Installation

There is NO installation required for this project. (Precisely, installations will be processed in Colab notebook).

Just open the Colab notebook and run the code from top to bottom by clicking play buttons on the left side one by one! 

How to Use After Running the Code?

1. Change language to "CN" if you need a Chinese UI

2. Authorize the notebook to access your Google Drive while the pop-up window appears.

🔔 You can skip this step if you have a ChatGPT API key that you are sure works.

3. Scroll the scrollbar to the bottom directly and patiently wait for something to be printed under the code.

4. If "Y" was entered in the previous step, you'll see Quick Start List. Please enter the number of the prompt you like then to start the chat quickly & conveniently.


🔔 "N"/"P" for next/previous page or "Q" to quit


5. Set parameters if neccesary.

6. Wait for the answer and continue chatting.

7. Enter "Q" merely if you don't wanna chat anymore and then the number of tokens of ChatGPT API you spent in this chat will show up.


8. When you're finished chatting, the chat record will be saved with your consent as a docx file in your Google Drive folder (/content/drive/MyDrive/Colab Notebooks/ChatGPT_API) , which will be built if not exsist.

🔔 Once that folder contains any chat record, a list of recorded chats named "【History】" will appear first for selecting before the query of the intention to use prepared prompts.

FAQ

❓ Cannot find ChatGPT_API_keys.txt in connected Google Drive since it's not prepared.


💡 Actually, API keys can be read from Google Sheet as well if there's a Google Sheet API file named GSheet.json in your Google Drive and your ChatGPT API keys are stored in a Google Sheet which already connects to Google Sheet API row by row, which is convenient to edit on the smartphone. Provide the Google sheet id to do so. Or you can just create a txt file with your own API keys and upload it to your Google Drive, which may be the fastest way to solve this problem.

❓ An error pops and says "There's no usable API key, please try something new!"


💡 It's because the API key you copied is unusable or there's no usable API key in ChatGPT_API_keys.txt. Just copied a new API key or add some new API keys of your other account into it and try again or wait for a while.



❓ Something different from the above.


💡 Send mail to [email protected] and explain in detail.

Reference


This project is a Colab notebook that integrates with the ChatGPT-3.5 API to act as a chatBOT, which is not only convenient but also useful. The notebook includes built-in keywords in both English and Chinese that you can select to start a chat quickly. Chat records will be saved in "docx" format and stored in your Google Drive folder, which makes it easier to read when not login in . If there're existing chat records in the folder, they'll be listed for you to choose and continue the conversation seamlessly. And what's more, you can even send your chat records toward friends to read or to continue your conversation seamlessly.
Avatar of the user.
Please login to comment.

Published: Apr 30th 2023
51
6
0

Tools

python
Python

useful
ChatBOT
AI
ChatGPT
OpenAI

Share