This repository contains a project that integrates WhatsApp with the ChatGPT (GPT-3.5) language model using the WhatsApp-Web.js library. With this integration, you can send messages to the WhatsApp number linked to ChatGPT and receive responses generated by the model.
The project uses the following technologies and services:
WhatsApp-Web.js: A Node.js library for interacting with WhatsApp. ChatGPT (GPT-3.5): A powerful language model capable of generating coherent and relevant text. Prerequisites
Node.js Environment: Make sure you have Node.js installed on your machine. Configuration
Clone this repository to your local machine. Install the required Node.js packages listed in the package.json using: npm install. Set up your ChatGPT API key in the main.js file.
Start the WhatsApp-Web.js client using: node whatsappClient.js. This will launch a QR code that you need to scan with your WhatsApp app to authenticate. Once authenticated, the client will start listening for incoming messages. Send a message to the WhatsApp number that is linked to the WhatsApp-Web.js client. The client will process the incoming message, call the ChatGPT API using the provided API key, and send the generated response back to the same WhatsApp number. Note
Keep in mind that ChatGPT is a language model and can generate responses based on its training data. It does not have specific contextual knowledge and may provide inaccurate or unexpected answers. Use it responsibly and avoid sharing sensitive information.
Contributions to improve and develop this project are welcome! If you encounter any issues or have suggestions, please open an Issue or submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE.md file for details.
Caio Medeiros - github.com/caiomdrs