Git Product home page Git Product logo

shamspias / whatsapp-voice-gpt Goto Github PK

View Code? Open in Web Editor NEW
22.0 3.0 4.0 53 KB

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.

Python 100.00%
chatbot gpt-3 gpt-3-5-turbo gpt-35-turbo gpt-4 openai openai-api voice-chat voice-chat-bot voice-recognition

whatsapp-voice-gpt's Introduction

WhatsApp Voice GPT Chatbot: SonicAI

Overview

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.

Features

  • Engaging text-based conversations with GPT-3.5-turbo-powered AI
  • Voice message recognition and processing
  • Dynamic conversation tracking and history
  • Supports commands to clear conversation history
  • Utilizes asynchronous tasks with Celery for efficient request handling
  • Built with Flask, Twilio API, and OpenAI API

Installation

To set up SonicAI, follow the steps below:

  1. Clone the repository:
git clone https://github.com/shamspias/whatsapp-voice-gpt.git 
  1. Change into the project directory:
cd whatsapp-voice-gpt
  1. Create a virtual environment:
python3 -m venv venv
  1. Activate the virtual environment:
source venv/bin/activate
  1. Install the dependencies and install redis-server:
pip install -r requirements.txt
  1. Create a Twilio account and get your account SID and auth token. You can find the instructions here.
  2. Create an OpenAI account and get your API key. You can find the instructions here.
  3. Create a .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
  1. Run the celery worker:
celery -A app.celery worker --loglevel=info
  1. Run the flask server:
python app.py
  1. Expose the flask server to the internet using a tunneling service like ngrok. You can find the instructions here.
  2. Add the ngrok URL to your Twilio phone number's messaging webhook. You can find the instructions here.
  3. Add the ngrok URL to your Twilio phone number's voice webhook. You can find the instructions here.
  4. Send a WhatsApp message to your Twilio phone number to start a conversation with the chatbot.
  5. Send a WhatsApp voice message to your Twilio phone number to start a voice conversation with the chatbot.
  6. Send a WhatsApp message to your Twilio phone number with the command /clear to clear the conversation history.
  7. Send a WhatsApp message to your Twilio phone number with the command /help to view the list of available commands.

Contributing

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.

whatsapp-voice-gpt's People

Contributors

shamspias avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.