WhatsApp chat assistant that provides completions using privateGPT. Allows audio messages using the Deepgram API.
To run this application, ensure you have the following:
- Node.js installed.
- A valid WhatsApp account.
- Deepgram API key (if using the transcription feature).
- Clone this repository.
- Install dependencies by running
npm install
. - Create a
.env
file based on the provided.env.example
and set the necessary environment variables. - Run the application using
npm start
.
Once the application is running, follow these steps:
- Scan the QR code displayed in the terminal using your WhatsApp mobile app to authenticate.
- Once authenticated, the application will start listening for incoming messages.
- Messages received from authorized users will be processed, and completions will be provided.
- PORT: Set the application port.
- PRIVATE_GPT_URL: URL for the privateGPT client.
- PRIVATE_GPT_SYSTEM: privateGPT system prompt to modify behaviour.
- ALLOWED_USERS: Comma separated list of authorized users' phone numbers (51999999999@c.us).
- DEEPGRAM_API_KEY: Add your Deepgram API key to enable transcription of audio messages.
index.js
: Main entry point of the application.page.js
: Contains functions to serve the HTML page.client.js
: Initializes the WhatsApp client and handles message processing.dpgm.js
: Handles audio transcription using the Deepgram SDK.pgpt.js
: Provides functions to generate completions for given prompts.
This project is licensed under the MIT License.
This application utilizes the privateGPT, refer to their documentation for more information.