SonicAI is a WhatsApp Chatbot designed to provide users with a convenient and engaging way to interact with an AI assistant. Powered by OpenAI's GPT-3.5-turbo, SonicAI offers a responsive and dynamic chat experience that can help users with a variety of tasks and inquiries.
SonicAI is built using Python, Flask, Twilio API, and OpenAI API. The chatbot utilizes asynchronous tasks with Celery to handle user requests and communicate with the OpenAI API efficiently. It supports both text and voice messages, allowing users to interact with the chatbot in their preferred format. The project is designed to be easily deployable and scalable, offering a seamless integration with WhatsApp.
To set up SonicAI, follow the steps below:
git clone https://github.com/shamspias/whatsapp-voice-gpt.git
cd whatsapp-voice-gpt
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
.env
file in the project directory and add the following environment variables or copy the contents of .env.example
into the .env
file:TWILIO_ACCOUNT_SID=your_twilio_account_sid
TWILIO_AUTH_TOKEN=your_twilio_auth_token
TWILIO_PHONE_NUMBER=your_twilio_phone_number
OPEN_AI_KEY=your_openai_api_key
CELERY_BROKER_URL=your_celery_broker_url
CELERY_RESULT_BACKEND=your_celery_result_backend
SYSTEM_PROMPT=your_system_prompt
celery -A app.celery worker --loglevel=info
python app.py
/clear
to clear the conversation history./help
to view the list of available commands.Contributions are welcome! If you'd like to contribute, please submit a pull request or open an issue with your proposed changes or bug reports.