This is a backend application that allows users to chat with ChatGPT with their voice. It integrates the Whisper API for automatic speech recognition (ASR) and the ChatGPT API for generating responses.
- Voice-based interaction with ChatGPT.
- ASR integration using Whisper for accurate speech recognition.
- Seamless conversation flow with persistent context.
- Easy to integrated to any web application.
- Provided Frontend Demo
Before running this application, make sure you have the following installed:
- Node.js (v14.16.1 or higher)
- NPM (Node Package Manager)
- Clone this repository to your local machine:
git clone https://github.com/stevetsim/ChatGPT-Voice-Driven-Chatbot.git
- Change into the project's directory:
cd ChatGPT-Voice-Driven-Chatbot
- Install the dependencies:
npm install
To use the Whisper and ChatGPT APIs, you need to provide your Open AI API key. Follow the steps below to configure the application:
-
Rename the
.env.example
file to.env
. -
Open the
.env
file and replaceOPENAI_TOKEN
with your actual Open AI API Key.
- Start the server:
node index.js
-
The server will be running at http://localhost:3000.
-
Use an API testing tool or a client application to send POST requests to http://localhost:3000/api/send with the following curl example:
curl --location --request POST 'localhost:3000/api/send' \
--form 'file=@"testing.mp3"'
- The response will be returned as a JSON object:
{
"success": true,
"message": "Get ChatGPT Response Success",
"data": {
"response": "I'm doing great. How can I assist you today?"
}
}
Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.
MIT License