Skip to content

sdmydbr9/MMM-Chat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MMM-Chat

Magicmirror module to chat with chat gpt

This module assumes that your default installation location is /home/pi/MagicMirror. If youre using other locations, please update the node_helper.js with your correct directory.

You can chnage the personality of the AI by editing line 26 in MMM-Chat.js. by default it is set to drunk AI

For example to make it sarcastic use this prompt "Your name is Marvin and you are a paranoid android that reluctantly answers questions with sarcastic responses." in the MMM-Chat.js

}

Installation instruction

  1. git clone https://github.com/sdmydbr9/MMM-Chat.git
  2. cd MMM-Chat
  3. pip3 install -r requirements.txt

Add the credentials to the MMM-Chat directory

I have provided another script to use with the whisper api, but while testing didnt really provide as much accuracy as the google STT. Feel free to use the whisper.py with little modification to the node_helper.js (line 21). You will have to install the openai python library

Get the credentials for google speech to text

You will need google service account credentials and a billing account, go through the pricing, they offer a free quota and if you stay within that you will not be charged

  1. Go to the Google Cloud Console. ([https://console.cloud.google.com/])
  2. Create a new project or select an existing project.
  3. Navigate to the APIs & Services > Credentials page.
  4. Click Create credentials and select Service account key.
  5. Choose a service account name and select the Editor role.
  6. Go to the service account and click on add key.
  7. Select JSON as the key type and click Create.
  8. The JSON key file will be downloaded to your computer. Note the file path and name, as you will need to specify this in your Python code transcript.py.
  9. Or you can just rename it to credentials.json and place the credentials to the MMM-Chat directory.

to test if your set up was successful just run

python3 transcript.py
  

And speak in the microphone, it will output with the transcription of your spoken words.

just add the following lines to your config

        {
    module: "MMM-Chat",
    config: {}
    },

Todo

Add prompt option in the config.js according to different personalities

About

Magicmirror module to chat with chat gpt

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published