Just a simple fork of the NextJS demo for messing around with the OpenAI API. Adds a basic chat interface for freeform interaction with a text model. Also implements the Whisper API to record and transcribe user audio messages, as well as the Google Cloud text-to-speech API to narrate bot responses.
Your own personal conversation bot! Talk to him, laugh with him, cry with him. He is here to help you, not to destroy the essential fabric of modern society.
-
If you don’t have Node.js installed, install it from here (Node.js version >= 14.6.0 required)
-
Clone this repository
-
Navigate into the project directory
$ cd openai-quickstart-node -
Install the requirements
$ npm install
-
Make a copy of the example environment variables file
On Linux systems:
$ cp .env.example .env
On Windows:
$ copy .env.example .env
-
Add your API key to the newly created
.envfile -
You'll need to create a Google Cloud Platform account if you don't have one, and follow the steps to create a service account key for the Text To Speech API. Place the JSON key file in the root folder and set the path in the
.envfile. -
Run the app
$ npm run dev
You should now be able to access the app at http://localhost:3000!
