Wikipedia link
Lets have a chat with ChatGPT4,
BUT for REAL,
Lets have a call.
We are best friends.
This script is using OpenAI STT, chat and TTS models, to have a real feeling chat.
- Raspberry pi 3 B
- USB headset (microsoft LiveChat)
- Switch
- 5 mm LED
- 2 X 220 kOhm resistors
- Old wireless telephone.
- Taking apart an old DECT telephone.
- Disconnecting speaker
- Soldering LED + resistors + switch to cable.
- Disassemble USB headset:
- Testing cable on raspberry pi.
- Soldering USB speaker and microphone wires to telephone, adhering the button to back cover with hot glue and adhering the LED to front cover with hot glue.
- Closing all together.
- If there where old message files, they will be deleted from the folder.
- A pre recorded welcome message will play to the user.
- User press the button and record a new message.
- When releasing the button, the message converted to MP3 and sent to OpenAI Whisperer module - Speech To Text (STT).
- The replied transcript then sent to OpenAI ChatGPT 4 module.
- The replied generated text then sent to OpenAI Text To Speech module (TTS).
- The replied MP3 then converted to WAV and played back to the user.
Install ffmpeg on machine:
git clone sdebby/telegraph
pip install -r requirements.txt
python ChatWithLinux1.py -d [x]
Obtain Open AI API key and save in in environment as "OpenAI_Key" (or replace the key in file OpenAIHelper.py)
parameters:
-h help
-l list of USB devices
-d [x] use USB device no. x
- If using a Raspberry pi (like in this project) and need to adjust volume:
alsamixer
- Adjust USB device volume and exit
- Save configuration:
sudo alsactl store
- Due to the ping-pong method (sending voice,receiving text, sending text, ect ...) there is a long delay from when talking to receiving answer.