Saarthi - Voice Assistant over IVR
Saarthi is a powerful Flask application that acts as a voice assistant and chatbot. It allows users to interact
with Saarthi by calling a designated IVR (Interactive Voice Response) number and engage in voice-based
conversations. The application leverages transcription to convert speech to text, processes the text input using
OpenAI's ChatGPT API, generates contextually relevant responses, and converts them back to speech using Twilio.
Saarthi provides a seamless and intuitive voice interface, enabling users to continue conversations until they hang
up the call. The application's flexibility and customization options make it suitable for a wide range of
applications, while contributions are welcome to enhance its features and performance. For more information,
click here to call Saarthi.
Prerequisites
- Python 3.x installed
- A Twilio account and a phone number with voice capabilities
- An OpenAI API key
- Flask and other required dependencies installed (check requirements.txt)
Installation
- Clone the repository:
git clone https://github.com/RoyalMamba/MeraSaarthi.git
- Change into the project directory:
cd MeraSaarthi
- Install the required dependencies:
pip install -r requirements.txt
- Set up the environment variables:
- ACCOUNT_SID: Your Twilio account SID
- AUTH_TOKEN: Your Twilio authentication token
- OPENAI_API: Your OpenAI API key
- Start the Flask application:
python main.py
Usage
- Ensure the Flask application is running.
- Configure your Twilio phone number's voice URL to point to
the deployed URL or ngrok URL followed by /call.
- Call the Twilio phone number and interact with Saarthi by speaking.
- Saarthi will convert your speech to text using transcription, process it using the ChatGPT API, generate a
response, and convert it back to speech using Twilio.
- Continue the conversation with Saarthi until you hang up the call.
Customization
- You can customize the welcome message, voice prompts, and conversation flow by modifying the respective
TwiML responses in the main.py file.
- The behavior of the ChatGPT API can be modified to fine-tune the responses generated by Saarthi. Refer to the
OpenAI documentation for more details on customizing the chat model.
Contributing
Contributions to Saarthi are welcome! If you encounter any issues or have suggestions for improvements, please
open an issue or submit a pull request.
Creators
-
Reetik Gupta
-
Saurabh R Yadav
License
This project is licensed under the MIT
License.