ChatGPT has become one of the most popular AI algorithms since its release in November 2022. Developers and enterprises immediately started adding voice control to ChatGPT and using ChatGPT in voice assistants, such as DaVinci.
DaVinci
is a voice assistant developed by David Bleisch. It uses
- Porcupine Wake Word to detect a wake word
- Cobra Voice Activity Detection to determine when the user begins and finishes speaking their query
- Leopard Speech-to-Text to convert the spoken query into text
- PvRecorder to pass voice inputs to voice AI engines
- OpenAI ChatGPT to generate answers to the query
- Amazon Polly Text-to-Speech to read the text response
It takes five steps to get DaVinci
ChatGPT AI Virtual Assistant running. Let’s start with prerequisites!
Prerequisites
- OpenAI Platform account and API key to integrate ChatGPT.
- Picovoice Console account and AccessKey to integrate Porcupine Wake Word, Cobra Voice Activity Detection, and Leopard Speech-to-Text.
- AWS and an AWS IAM account with valid Access Keys to integrate Amazon Polly.
- Raspberry Pi 4 that is ready to run. You can find the full list of recommended hardware under hardware requirements and setup instructions in this Raspberry Pi tutorial. Make sure you load the 64-bit version of the OS.
Picovoice and AWS offer Free Tiers that are sufficient for any hobbyist to reproduce and use DaVinci. OpenAI offers free credits to be used within the first 3 months after signing up. We acknowledge that OpenAI can be expensive for a hobbyist running experiments. If that’s the case, you can look at open-source large language model alternatives.
Step 1: Reboot your Raspberry Pi
- Open a terminal and enter the following command to open the
bashrc
file:
- Scroll to the bottom of the file using your keyboard and add the following lines at the end (be certain to include the #s):
- Press the
CTRL
andX
keys simultaneously on your keyboard, then pressY
, and then pressEnter
to save the revisions to the file. Then enter the following command:
Step 2: Install AI Software
When asked if you want to continue, enter Y
and then press Enter
Log back in after the reboot.
Step 3: AWS Configuration
Open a terminal and enter the following command:
The following lines will appear one by one. Take the actions specified in the brackets:
- AWS Access Key ID [None]: [Type in your
access key ID
and pressEnter
.] - AWS Secret Access Key [None]: [Type in your
secret access key
and pressEnter
.] - Default region name [None]: [Find the closest region to you and type the name, such as "us-east-1".]
- Default output format [None]: [leave this blank and press
Enter
]
Step 4: Clone and Modify DaVinci
- Download the
GPTModelCompare.py
program and associated files by opening a terminal and entering the following command:
- Modify
DaVinci.py
to add theOpenAI API Key
andPicovoice AccesKey
. Open a terminal and enter the following commands:
- Use your keyboard to scroll down to find the below lines and replace the placeholders with your
API
andAccess keys
.
Press the
CTRL
andX
keys simultaneously on your keyboard, then pressY
, and then pressEnter
to save the revisions to the file.Move the
DaVinci keyword file
to thePorcupine raspberry-pi folder
by entering the following command. Note that there are two blank spaces betweenmv
and/home
and between.ppn
and/home
.
- Reboot your Raspberry Pi.
Step 5. Run DaVinci
- Plug your microphone and speaker into USB ports on your Raspberry Pi 4.
- To run the program, open a terminal and enter the following commands:
You can then wake up your DaVinci
ChatGPT AI Virtual Assistant by saying one of the following wake words: ‘DaVinci’, ‘Computer’, or ‘Jarvis’.
Porcupine Wake Word can process multiple wake words in multiple languages simultaneously.
After the wake word, DaVinci
ChatGPT AI Virtual Assistant will respond by saying “How may I assist you?”, “I’m listening.” or something similar. Then make your request. For example, say:
- “Describe purple.”
- “What would happen if the moon disappeared?”
- “What is the meaning of the song Stairway to Heaven by Led Zeppelin.”
- “Tell me a story about a mouse named Mike, who is looking for his lost cheese in the Astrodome.”
- “Write a short poem about artificial intelligence.”
You can find more information, including 3D printing tips, on DaVinci’s GitHub Repo. Do not forget to give it a star if you like DaVinci
- the ChatGPT AI Virtual Assistant project. GitHub stars help fellow developers find repos easily and encourage maintainers to continue working on those projects.