This project is a Twitch chatbot that uses the OpenAI GPT-3 language model and Socket.io to provide a conversational AI experience for users. It also includes text-to-speech functionality using the SpeechSynthesis API. And uses google-cloud/text-to-speech for TTS. Now with socket.io rooms so multiple users can use the app a the same time. Each user has their own message history. New rooms are created everytime the page is loaded (or refreshed).
- Clone the repository
- Navigate to the project directory
- Run
npm install
- Create a
.env
file in the root of the project directory and add your OpenAI API key asOPENAI_API_KEY=your-key-here
- Start the server with
npm start
- Create a
google-credentials.json
file with a google cloud service account that can us google-cloud/text-to-speech.
- Open the project in your web browser at
http://localhost:3000
- Click the "Start Listening" button
- Say "computer" to trigger the chatbot
- Speak your message and wait for a response
Note: The webkitSpeechRecognition
API used for voice recognition has spotty support and has only been tested in Google Chrome Version 110.0.5481.178.
This project uses the following dependencies:
express
for the web serverdotenv
for environment variable managementopenai
for the GPT-3 language modelsocket.io
for real-time communication with the servercensor-sensor
for profanity detection and filtering@google-cloud/text-to-speech
for tts
This application uses the following technologies:
- Node.js
- Express.js
- Socket.io
- OpenAI
- ChatGPT
- Google Cloud Text-to-speech
- Bootstrap5
The majority of the code was generated through ChatGPT, an OpenAI-powered tool that allows users to easily create conversational agents using GPT-3.