- Navigate to a chat room
- Click on the "Analyze Emotion" button
- Allow the app to access your webcam
- A video will appear below. Please ensure your face is visible to the webcam
- After a couple of seconds, your face will be tracked and your emotions will be detected
- Click on the video and a response will be generated for you
Enabling Generated Responses
- Navigate to a chat room
- Click on the "Generate Response" button
- Select the user you want to write the message to in the pop-up
- Select the number of previous messages in the pop-up
- Click "Done" and a response will be generated for you
Turning Voice to Text
- Navigate to a chat room
- Click on the "Record Voice" button
- Allow the app to access your microphone
- Speak into your microphone
- Click "Stop Recording" when you are finished speaking and a response will be generated for you AI Model Choice
The integration utilizes the face-api.js library for facial emotion recognition along with OpenAI for generating responses and voice-to-text transcription. Here is a list of dependencies along with their versions:
"dotenv": "^16.4.5",
"express": "^4.18.2",
"express-fileupload": "^1.5.0", "face-api.js": "^0.22.2",
"mongodb": "^6.4.0",
"openai": "^4.33.0",
"ws": "^8.16.0"
This list can be found inside package.json. Please ensure MongoDB is running on mongodb://127.0.0.1:27017 There is one API Key for OpenAI. You will need your own if you want to use the AI features. Please create a
.env
file in the project's root directory and paste OPENAI_API_KEY="your API key"
within it.
- Clone the repository- Install dependencies in the root directory of the project: npm install
- Create a .env folder in the root directory of the project
- Set the OpenAI API Key in
.env
as OPENAI_API_KEY="your API key"
(replace with actual key)- Run the command
npx webpack --config webpack.config.js
if changes made to app.js- Start the server by typing
node server
in your console- Open the client application in your browser (http://localhost:3000/)