๐Ÿš€ Getting started

  1. Install embedchain python package:
pip install --upgrade embedchain
  1. Launch your WhatsApp bot:
docker run --name whatsapp-bot -e OPENAI_API_KEY=sk-xxx -p 8000:8000 embedchain/whatsapp-bot

If your bot needs to be accessible online, use your machineโ€™s public IP or DNS. Otherwise, employ a proxy server like ngrok to make your local bot accessible.

  1. Create a free account on Twilio
    • Set up a WhatsApp Sandbox in your Twilio dashboard. Access it via the left sidebar: Messaging > Try it out > Send a WhatsApp Message.
    • Follow on-screen instructions to link a phone number for chatting with your bot
    • Copy your botโ€™s public URL, add /chat at the end, and paste it in Twilioโ€™s WhatsApp Sandbox settings under โ€œWhen a message comes inโ€. Save the settings.
  • Copy your botโ€™s public url, append /chat at the end and paste it under When a message comes in under the Sandbox settings for Whatsapp in Twilio. Save your settings.

๐Ÿ’ฌ How to use

  • To connect a new number or reconnect an old one in the Sandbox, follow Twilioโ€™s instructions.
  • To include data sources, use this command:
add <url_or_text>
  • To ask the bot questions, just type your query:
<your-question-here>

Example

Here is an example of Elon Musk WhatsApp Bot that we created: