Catch-up Companion is a WhatsApp bot designed to help you stay up-to-date with your group chat conversations. By summarizing the last n messages in a group chat, Catch-up Companion allows you to quickly catch up on missed conversations. The bot is built using Twilio, Flask, and the OpenAI GPT API. 🤖
- Add the bot to WhatsApp group chats 📱
- Summarize the last n messages in a chat
- Automatic summarization using the OpenAI GPT API 🚀
- Python 3.6 or later
- Twilio account
- OpenAI GPT API key
- Flask
- Clone the repository
git clone https://github.com/antoinekllee/catch-up-companion.git
cd catch-up-companion
- Install the required packages
pip install twilio flask openai
- Set up a Twilio account and connect it to WhatsApp
- Sign up for a free Twilio account (https://www.twilio.com/try-twilio)
- From the Twilio Console, go to the "All Products & Services" menu and click on "Programmable SMS"
- Click "Try it Out" and then "Try WhatsApp"
- Follow the instructions to connect your WhatsApp account to your Twilio Sandbox environment
- Set up an OpenAI GPT API key
- Sign up for an API key at OpenAI (https://beta.openai.com/signup/)
- Note down your API key for the next step
- Configure the bot
- Create a
.env
file using the provided.env.template
file - Fill in the following information in the
.env
file:OPENAI_KEY
with your OpenAI GPT API keyTWILIO_SID
with your Twilio Account SIDTWILIO_TOKEN
with your Twilio Auth TokenBOT_PHONE_NUMBER
with your Twilio Sandbox phone number
- Run the bot
python app.py
- Expose your local app to the internet
- Use a tool like ngrok (https://ngrok.com/) to expose your local app to the internet:
ngrok http 5000
- Copy the ngrok URL (e.g.,
https://your-ngrok-url.ngrok.io/bot
) and configure it as the webhook for your Twilio WhatsApp Sandbox (in the Twilio Console)
- Test the bot
- Add the bot to your WhatsApp group chat
- To get a summary of the last n messages, send "summarise n" to the group chat
- Add the bot to your WhatsApp group chat
- When you want to catch up on missed conversations, send a message in the format
summarise n
(e.g.,summarise 10
) - The bot will summarize the last n messages in the group chat and send the summary back to the group
This project is licensed under the MIT License - see the LICENSE file for details.