This is a chatbot application designed to run on WhatsApp, leveraging the WhatsApp Business API. It's built using Python and Flask, and it can handle various tasks such as responding to user inquiries, managing inventory, scheduling events, and providing information on cleaning services using openAI capabilities.
- Automated Responses: Engage with users by answering their questions and providing information automatically.
- Inventory Management: Users can inquire about stock levels or update inventory through the chatbot.
- Event Scheduling: Schedule events or meetings directly through conversations with the chatbot.
- Cleaning Service Inquiries: Users can get information about cleaning services, schedule cleanings, or inquire about service details.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
- Python 3.x
- Flask
- ngrok (for local development and testing)
- A WhatsApp Business API account
-
Clone the Repository
git clone https://yourrepository.com/yourproject.git cd yourproject
-
Set Up a Virtual Environment
python3 -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install Required Packages
pip install -r requirements.txt Configure Your Application
Update config.py with your WhatsApp Business API credentials, including ACCESS_TOKEN, APP_ID, APP_SECRET, and PHONE_NUMBER_ID.
-
Start the Flask Application
bash python3 main.py
-
Expose Your Local Server (Using ngrok)
ngrok http 8000 Note the forwarding URL provided by ngrok, which will be used to set up the webhook.
-
Configure the Webhook
Go to your Facebook Developer Console and set the webhook URL to the ngrok forwarding URL followed by /webhook.```
Send a message to your WhatsApp Business number to interact with the chatbot and test its functionalities.
For production deployment, consider using a cloud service provider like AWS, GCP, or Azure to host your application. Ensure that your production environment is secure and that you've configured your WhatsApp Business API webhook URL to your production server's address.
Python - The programming language used. Flask - The web framework used. ngrok - Used to expose local servers behind NATs and firewalls to the public internet over secure tunnels.
- Doesn't support multiple requests
- On Gpt-3, some of the functions don't work because of context-length. Switching to GPT-4 will blow up the API cost
We use SemVer for versioning. For the versions available, see the tags on this repository.
Acknowledgments