Git Product home page Git Product logo

royalmamba / merasaarthi Goto Github PK

View Code? Open in Web Editor NEW
9.0 1.0 0.0 202 KB

Saarthi is a Flask-based voice assistant and chatbot. It converts speech to text, processes user input with OpenAI's ChatGPT API, and generates responses. With Twilio integration, users can call and interact with Saarthi. Customize the conversation flow and contribute to this open-source project. Let's chat with Saarthi!

Home Page: https://saarthimera.onrender.com/

License: MIT License

Python 37.17% Dockerfile 5.47% CSS 15.48% HTML 41.88%
chatgpt ivr voice-assistant voice-recognition openai-api python twilio rag

merasaarthi's Introduction

Saarthi - Voice Assistant Application

Saarthi is a Flask application that acts as a voice assistant and chatbot. Users can call a designated IVR (Interactive Voice Response) number and interact with Saarthi by speaking. The application converts the user's speech to text using transcription, processes the text input using OpenAI's ChatGPT API, generates a response, and converts the response back to speech using Twilio. The conversation continues until the user hangs up the call.

Features

  • Call an IVR number and interact with Saarthi using speech input
  • Convert user's speech to text using transcription
  • Process user's text input using OpenAI's ChatGPT API
  • Generate a response based on the user's input
  • Convert the response to speech using Twilio
  • Continue the conversation until the user hangs up the call

Prerequisites

Before running the application, ensure you have the following:

  • Python 3.x installed
  • Twilio account and phone number with voice capabilities
  • OpenAI API key
  • Flask and other required dependencies installed (check requirements.txt)

Installation

  1. Clone the repository: git clone https://github.com/RoyalMamba/MeraSaarthi.git

  2. Change into the project directory: cd MeraSaarthi

  3. Install the required dependencies: pip install -r requirements.txt

  4. Set up the environment variables:

  • ACCOUNT_SID: Your Twilio account SID
  • AUTH_TOKEN: Your Twilio authentication token
  • OPENAI_API: Your OpenAI API key
  1. Start the Flask application: python main.py

Usage

  1. Ensure the Flask application is running.

  2. Configure your Twilio phone number's voice URL to point to the deployed URL or ngrok URL followed by /call. For example: https://your-app-url.com/call
    Note: It is recommended to run the code in an Online Integrated Development Environment such as Replit because Twilio works on webhooks and running it on localhost won't work until we use ngrok to create a tunnel

  3. Call the Twilio phone number and interact with Saarthi by speaking. Calling won't be available if the user does not have a preminum account hence the can call it via endpoint to initiate a call from the server.

  4. 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.

  5. 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.

License

This project is licensed under the MIT License.

References

For more details about the research and development of Saarthi, refer to the RESEARCH file.

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.