WhatsApp and ChatGPT integration ― autoresponder for WhatsApp conversations
TimelinesAI allows you to set up a ChatGPT-powered auto-responder in your WhatsApp account without code or external automation tools!
You can tailor ChatGPT response to your needs, by providing instructions in plain language in prompt field. Use the default prompt as a basis and modify it as needed. You can supply some background information on your business and instruct ChatGPT to respond differently, depending on whether it is the first message in the WhatsApp conversation.
You can select whether to activate the auto-responder in specific WhatsApp chats, or to enable it in all new chats that are created, when you receive a message from a new contact or start a new conversation.
For each incoming message received in a chat, where ChatGPT auto-responder is enabled, TimelinesAI will automatically respond with a text, generated by ChatGPT.
How does it work?
We use ChatGPT text-davinci-003 model with up to 1000 tokens per single request (you can read more about tokens and pricing here). Up to 16 most recent WhatsApp messages in the conversation will be supplied together with the prompt, to allow for highly relevant and context-aware replies.
Most human languages are supported, however, the quality of response depends on the language and cannot be guaranteed. In addition, languages other than English may use significantly more tokens.
ChatGPT WhatsApp auto reply is activated with a delay of 5 seconds after the message was received, to allow for the human operator to respond.
ChatGPT infrastructure can occasionally experience load or be unavailable. If we are unable to obtain a ChatGPT response successfully, up to 3 more attempts will be made. Please allow additional time (usually up to 10 seconds) in addition to the initial delay, until an automatic response is sent to the user.
If you run into any technical problems or are interested in custom settings, please contact us at email@example.com).
You can setup a ChatGPT-powered WhatsApp autoresponder in a few simple steps:
1. Register or login at OpenAI’s site: https://openai.com/api/
2. Navigate to API Keys section and create a new API Key. Copy the key to clipboard.
3. Navigate to TimelinesAI ChatGPT settings page and enter the API Key.
* ChatGPT settings menu item is available in the left sidebar in TimelinesAI. If you can’t see this option, contact support to request access to this feature for your workspace.
You’ll see the following settings within this section:
- Chat History Word Limit: The limit on the number of words from chat history, that will be supplied to the ChatGPT for response generation together with the prompt.
- Chat History Depth: The number of messages from the chat history provided to ChatGPT for response generation, in conjunction with the prompt.
- Auto-response Override Delay: This is a specified period (in seconds) allowing a manual operator to reply from any WA session. If the operator sends a manual response within this timeframe, ChatGPT will not produce an automatic response.
- ChatGPT Max tokens: The maximum number of tokens that can be processed or generated by ChatGPT in a single response. Tokens can be thought of as chunks of text. In English, a token can be as short as one character or as long as one word.
- ChatGPT temperature: This setting controls the randomness of the model’s responses. A higher value makes outputs more varied and creative, while a lower value results in more deterministic and focused answers. Adjusting the temperature allows for fine-tuning the balance between unpredictability and consistency in ChatGPT’s replies.
- ChatGPT top_p: This setting dictates the diversity of responses by selecting words based on their cumulative probability. A higher top_p results in more varied outputs, while a lower value leads to more deterministic responses. Contrastingly, ChatGPT temperature influences the randomness of the model’s outputs. In essence, while both parameters control randomness, temperature adjusts the entire probability distribution, and top_p confines the selection to a subset of top probable words.
- ChatGPT frequency penalty: This parameter influences the model’s preference for more or less frequent tokens (words or characters) in its responses. A positive value encourages the model to use less common tokens, making responses more unique, while a negative value promotes the use of more frequent tokens, resulting in more typical phrasing. Adjusting this parameter allows for fine-tuning the novelty or conventionality of ChatGPT’s outputs.
- ChatGPT presence penalty: This parameter adjusts the model’s inclination towards tokens it has already used. A positive value discourages repetition, prompting more diverse responses, while a negative value might encourage the reuse of certain tokens. This parameter aids in fine-tuning the variety or repetitiveness of ChatGPT’s outputs.
4. Edit the Prompt to supply appropriate instructions to the ChatGPT engine.
5. Check the “Activate ChatGPT” box
6. Open the WhatsApp accounts page and turn ON “ChatGPT auto-response” for the relevant numbers
7. Enable/Disable ChatGPT auto-responses for individual chats by opening the desired chat form the Chat View. Navigate to the relevant chat and click on “Enable ChatGPT autoresponse” to activate it in this chat:
7. Chats with enabled ChatGPT auto-response will have a corresponding label in the Chat View
Create a new filter to see all chats, where ChatGPT auto-response is enabled OR disabled. Open Chat View > Click “New Filter” > Under “ChatGPT auto-response enabled” select the desired parameter – disable only, enabled only or all.
Composing a prompt
ChatGPT receives instructions in plain human language. English is recommended for efficiency reasons.
Bear in mind, that in order to provide a conversation context, we concatenate up to 16 most recent messages in a conversation in the following format:
Remote: Hello! I am interested in custom software development, can you help me?
Me: Yes, we can help with custom software development. What kind of services are you looking for?
Remote: I would like to develop a mobile application
We recommend clear and specific instructions, that explicitly mention me and the “Remote” person. Consider a generic version of the prompt, for example:
Continue conversation in the same language, on my behalf.
If this is first message, just greet politely the Remote person.
Otherwise provide response based on the context of previous conversation.
Use short answers.
Feel free to provide additional context / instructions in the same way you would instruct a call center agent:
Continue conversation in the same language, on my behalf.
We are an insurance agency. If this is first message in conversation, ask the Remote person about her needs and contact details (full name, email). Otherwise provide response based on the context of previous conversation. Use short phrases.
- Customer.io: automated WhatsApp messages using TimelinesAI Public API - January 18, 2024
- Bitrix24 CRM & WhatsApp integration via Make.com - January 18, 2024
- How to Unban WhatsApp Number? (Latest Update 2024) - January 12, 2024