This is the bot that can. Powered by FastAPI and WhatsApp Business Cloud API.
- Intelligent Text and Image Input: Ask complex questions, get creative prompts answered, and explore different styles with Google's cutting-edge language models.
- Seamless WhatsApp Integration: Send and receive messages through WhatsApp, making AI accessible and convenient right at your fingertips.
- Huggingface Inference Support (Beta): Access a broad range of pre-trained models for diverse text tasks while exploring the potential of Huggingface's powerful ecosystem.
- Python 3.10.13
- FastAPI
- WhatsApp Business Cloud API credentials
- Google Cloud Platform (GCP) credentials/service account with access to Vertex AI (for Google LLMs)
- (Optional) Additional APIs specific to your desired functionality
Option 1: Easy Setup (Recommended)
-
Download the repository
git clone https://github.com/so-dipe/WhatsAppBot.git cd WhatsAppBot
-
Run the installation script:
./install.sh
Option 2: Manual Setup:,
-
Create a Python Virtual Environment in the repository:
python -m venv venv
-
Install dependencies in the virtual environment:
source venv/bin/activate pip install -r requirements.txt
-
Configure settings and Environment Variables
-
Copy the
sample_config.env
filecp sample_config.env .env
-
Open .env and replace the placeholder values with your credentials
-
If you plan on using google's models, paste a copy of your service account at
service_account_key.json
alternatively, run the
configure.sh
script./configure.sh
-
- Run
run_app.sh
bash script./run_app.sh
OR Manually start FastAPI and Redis servers.
-
Run FastAPI server
uvicorn app.main:app
in developement mode, use
uvicorn app.main:app --reload
by default, a port is opened on 8000.
-
Run Redis Server
redis-server config/redis.conf
config/redis.conf
contains the default config file used. -
Set up ngrok (if needed) to expose your local server to the internet:
ngrok http 8000
Note: WhatsApp Business API requires a webhook callback URL that must be accessible from the internet. Explore ngrok for a permanent domain if you prefer.
- Seamless Huggingface Inference API Integration: Empower users with a vast library of pre-trained models and a user-friendly model selection interface.
- Expand LLM Hosting Platform Support: Welcome DeepInfra, AnyScale, and potentially more to offer diverse LLM hosting options.
- Unleash Speech-to-Text Capabilities: Enable voice-based interactions for a more natural and accessible experience.
- Unlock the Power of Documents: Facilitate conversations around PDFs and document files for enriched knowledge sharing.
This project is licensed under the GNU General Public License v3.0. See the LICENSE file for details.