Integrations
Integrate WhatsApp with ChatGPT
Jan 29, 2023
ssIntegrating WhatsApp with a chatbot can have a number of benefits. It can help companies provide faster customer service by enabling customers to get answers to their inquiries quickly. It can also reduce operational costs by automating customer service requests. Additionally, OpenAI's natural language processing capabilities can help customers receive more accurate responses to their inquiries.
Using WA Toolbox's built-in workflows system, you can easily integrate your WhatsApp account with your pre-trained ChatGPT, follow the easy steps below.
Setting up OpenAI's account
Sign up for OpenAI's API and login to the dashboard
From the top right corner, hit your account's name and navigate to "View API keys"
Create a new API key, copy it, and keep it somewhere safe, we will use it in the next step
Setting up the agent
Go to your WhatsApp Web page, open WA Toolbox then navigate to the Integrations tab, and click the "Settings" button in the ChatGPT integration widget.
Insert the API Key that you obtained earlier, and set the maximum amount of tokens you want to spend per request (EX: 850). You can also set the last x amount of messages you want your agent to be aware of in the conversation before answering the user inquiry (Default is 5), and lastly, the AI model you want to use… then save the changes.
Now, we need to train your Agent so it can reply to your clients based on your business information. To do this, click the "Training" button in ChatGPT's widget in the Integrations tab, and let's start!
Business name: This field helps the agent mention your business name when it's needed.
General business information: This field should contain some detailed information about your business, for example: The type of the business, the services you provide, and any other general information your agent should be aware of.
Default reply to unknown questions: Here you can set a custom message to reply to your clients if the agent is unable to answer their inquiry, for example: "Sorry, I don't have that info, a human will be here to answer you soon".
Answer as short as possible: As you might know, AI likes to talk too much, and this option forces it to only focus on answering with short messages.
Business's most important FAQs: This section helps you train your agent with some predefined questions that you usually get from your clients, the more information you feed the agent, the more smart it will get while answering.
Important notice: English works best for AI models training, although you can train the model with any language, but English works best. Keep in mind that the agent will always answer in the client's language regardless of the training language.
Setting up the workflow
The workflow is the event listener that will capture the incoming messages and send them to the agent. Let's set up a simple workflow that represents our chatbot, let's set it up to listen for any message that comes to our WhatsApp account.
Using the asterisk symbol (*) as a keyword will get this workflow triggered for any incoming message, and then all you need to do is check the "Reply using ChatGPT agent" option and save your workflow. That's it!
Need more control? There is more
The ChatGPT integration in WA Toolbox has more advanced options. In case you want to have more control over your agent, here is what you can do more after enabling the "Advanced Settings" option:
Prepend text before ChatGPT response: This option allows you to prepend a text before any message sent by the agent, this helps you inform the client that this is a bot answering. Please note that all WhatsApp text formatting symbols are supported and that you can \n to insert new lines in the message.
Append text after ChatGPT response: This works the same as the above option, but it appends the text at the end of the message.
Additional custom training: This allows you to be creative forcing the AI model to follow specific instructions, feel free to feed your agent any custom prompts you might find important to improve the automated answer's experience.