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
- git clone https://github.com/sdmydbr9/MMM-Chat.git
- cd MMM-Chat
- 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
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
- Go to the Google Cloud Console. ([https://console.cloud.google.com/])
- Create a new project or select an existing project.
- Navigate to the APIs & Services > Credentials page.
- Click Create credentials and select Service account key.
- Choose a service account name and select the Editor role.
- Go to the service account and click on add key.
- Select JSON as the key type and click Create.
- 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.
- Or you can just rename it to credentials.json and place the credentials to the MMM-Chat directory.
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: {}
},