A full-stack application that utilizes the OpenAI API and continuously listens for voice input in the background, converts this input to text, processes the text with the GPT-4 model, and converts the model's response back into spoken voice.
- Node.js and npm installed on your local machine.
- An OpenAI API key.
-
Clone the repository to your local machine.
git clone https://github.com/aumbriac/GPT-Voice-Assist.git
-
Navigate to the
/server
directory.cd GPT-Voice-Assist/server
-
Rename
.env.example
to.env
.mv .env.example .env
-
Open the
.env
file in a text editor and replaceYOUR_OPENAI_KEY
with your OpenAI API key. -
Install the dependencies.
npm install
-
Start the server.
node server.js
-
Open another terminal and navigate to the
/client
directory.cd ../client
-
Install the dependencies.
npm install
-
Start the client application.
npm start
You should now have the server running on http://localhost:3001/
and the client running on http://localhost:3000/
.
-
Click on the "Click to Speak to GPT" button to activate voice recognition.
-
To activate GPT, say "GPT" into your device's microphone. A sound effect will play to indicate that GPT is ready to receive your command. You can say "cancel" or "nevermind" to deactivate GPT. GPT may be reactivated at any time by saying "GPT".
-
Speak your command or question to the microphone. The GPT assistant will listen to your command, send it to the OpenAI API, and convert the response back to voice.
-
Open the console to see the input and output logs. Note: logs will display only if
true
is passed as a second parameter toGPTVoiceAssist
.
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.