OpenAI's ChatGPT is experiencing heavy traffic and at the moment obtaining a session is difficult. You may get these messages while attempting to run the bot. If this happens, try again. Once you get a session, it seems to last quite a while (although it will eventually timeout.)
The ChatGPT NPM module will eventually move to use the official OpenAI API, and I will update this message when that happens.
Also - feel free to contribute via pull requests etc. :)
WhatsGPT is a wrapper for ChatGPT for personal or family use, that runs inside your own WhatsApp bot.
- Can keep track of multiple separate conversations
- Can be added to groups, and will respond to messages starting with @[its number or name]
My family and I find ChatGPT very useful want we want to use it on the go and I was bored on a Saturday morning, so here we are.
It's experimental and relies on the preview release of OpenAI's ChatGPT.
- A phone number that can receive text messages/voice calls, linked to its own WhatsApp instance.
- I use a Google Voice number, and run a 2nd instance of WhatsApp on my phone by using the WhatsApp for Business app (it's free!])
- Node JS >= 18
- A computer that can run Chrome (headless is now broken as OpenAI is using CloudFlare)
Clone the repository:
git clone https://github.com/pascalroget/whatsgpt.git
Install dependencies:
npm install
Create a .env file with the following variables. In this example, we are using Chrome on OSX.
CHROME_PATH=/Applications/Google Chrome.app/Contents/MacOS/Google Chrome
EMAIL=[Your email used to register with OpenAI]
PASSWORD=[Your password used to register with OpenAI]
npm start
Authentication with ChatGPT is a fluid situation. As of this writing, the chatgpt npm package now tries to login with a headfull browser to obtain and then refresh cookies.
Open a chat with the WhatsApp account linked to the number you just linked to this bot. ChatGPT will answer. This works for several users at the same time and each conversation is separate. Additionally, you can reset an ongoing conversation by sending this message:
reset