A conversational, voice-enabled, multilingual WhatsApp bot that can generate both text and image responses using APIMatic auto-generated SDKs for WhatsAppand OpenAI APIs.
Language
and Model
are the two reserved words that the user can send to the bot for switching between desired language and AI model.
git clone https://github.com/mehnoorsiddiqui/whatsapp-chatty-dalle.git
- Go to Meta to make a developer account.
- Create an App by following the getting started guide.
- You can find your Access token from the Meta for Developers site App
Dashboard > WhatsApp > Getting Started
.
- Go to the OpenAI website and sign up by filling out the registration form.
- Navigate to the
API keys
tab in your dashboard and generate a new API key.
To set up webhook on the Meta Developer portal (also enter matching verify token). You may use a service like ngrok to make your local app publicly accessible so this webhook can be registered with Whatsapp. []
- Rename the .env.example to .env.
- Replace the
WHATSAPP_TOKEN
with your token in the .env file. - Replace the
PHONE_NUMBER_ID
with yours in the .env file. - Replace the
VERIFY_TOKEN
with yours in the .env file. - Replace the
OPENAI_API_KEY
with yours in the .env file.
- Navigate to the OpenAI+API directory and run
npm install
- Navigate to the WhatsApp+Cloud+API directory and run
npm install
- Navigate to the root folder and run
npm install
Then, run the application in the command line and it can be tested by sending an audio message to test number given in the developer account.
npm start