I tried to install all the libraries. Only with PyAudio did this go wrong. Eventually, I got it to work. By the following commands: sudo apt install libasound-dev portaudio19-dev libportaudio2 libportaudiocpp0 After that sudo apt install ffmpeg and than run python3 -m pip install pyaudio Everything works great
Just came across, a totally amazing project. Perhaps the ultimate stage of this would be a bot that activates only on a certain voice command so what you chat in a room does not get sent to gpt unless you ask for this, and a real non-robotic voice of your choice. I am impressed, thank you!
you should just use llama2 or 3 , or any of the Local Language models , stop supporting the system they are watching us , its literally 1 command in linux to install llama2 or 3
Great ChatGPT chatbot! Awesome! Hi Thomas I have a Raspberry PI 5, a ollama with tinyollama setup on my system with an ollama webui as frontend. It works and the responses are good enough as far as speed is concerned. I already installed piper and the voice sounds natural and perhaps add whisper next for an all out local project. Do you know a way on how I can this all integrated together. I'll be looking forward to your next video.🌟🌟👍
When I copy and paste the libraries/dependencies code I get a externally-managed-environment error then I go into a virtual environment then do it again it works but then I get more errors stating that it can't find dotenv idk what I'm doing wrong but I followed this video to a T and nothing's working
I agree. Nothing but problems when installing the libraries. I wonder if anyone has successfully got this to work? Wasted hours of time trying to get this setup with my grandson.
Can you get it to control motors and LED's? I'm new to the GPT space and am seeking to make a complex arduino android controlled by types of responses. Like a wealth of animations triggered by the chat bot's reply, and the attitude it associates with it's response.
That actually sounds really cool. I would defo think about making a video on this . A gpt filter + split GPIO code into micro services will achieve this
this is awesome ive been trying to do the same project over the last week. i set up your code to use as an example for mine, but its running slow do you have any suggestions on how to speed it up? im running it on a rasp pi 4 8gb btw.
The speed of the python script depends on the speed of speech-text + API call + text-to-speech (roughly). So a better mic + a wired connection for internet is my recommendation.
There is also gTTS (by Google) but this has to connect back and forth with Google server to work so the latency of the chatGPT audio response can be worse.
Hacksmith just did a video with similar results but broader in scope. They has a non robotic voice. For me I can't wait for diy projects that do what Alexa was supposed to be
Wow, thanks for this video man. I was windering, once installed, how can you install this on a rc car? Have the system roam around with comouter vision, lidar, and other systems for obstacle avoidance, roaming around my property? Thanks again for this informative video.
@thomasthemaker lol dude, if you're gonna do that, go into detail on how to, coding, or share the code so I can build and install your code. Roaming bots! Lol pretty cool to have.
Awesome project! Just what I've been looking for. Thanks for this! [suggestion] Would've been better if the voice was less robotic. I think there are TTS models that does that.
This is awesome , thanks a lot , although I have not been able to make it properly run on raspberry pi zero w2 , have you tried it? It starts to listen and when triggered sometimes it works rcognizing speech sometimes it does not.
Thank you for the wonderful tutorial. Once the VLC is executed, the file finishes playing and the Listening for 'Hey'... It does not automatically turn into. VLC doesn't seem to be ending.
Great video Thomas! Thanks for sharing :) Could you probably provide us with some further information about how this mini microphone can be plugged in and used and what kind of speaker you connected to the Raspberry pi and how? Many thanks in advance!
Thanks for your immediate response! I already bought a mini microphone similar to the one you suggested in the video but indeed the quality of it is not that good. That’s why I asked. And what about the audio output do you use a HDMI adaptor for it? Thank you once again for the nice video and keep up the great work!
Excelente su video. Disculpa la pregunta se puede trabajar la IA CHATGPT sin estar inscrito o se debe tener un registro para poder realziar la aplicación de CHATBOT
Do you know how to change the voice, it would be good to change the voice to a famous voice clone, a movie star you love or a tv robot maybe even a star wars actor, first need to be able to clone the voice and I know there is a website that can do this but not sure about any of the rest of the process to make it work. If you do know how a video would be awesome, I loved this video, thank you.
I'm guessing he used the pyttsx3 module (havent taken a look at the code), which uses the operating system's built in text to speech technology. You could try using openai's tts model, but that would be more code and an extra cost. I *have* however, opted to use it for many personal projects.
I'm not super familiar with the China networking & v2ray but it does seem like most ai model APIs are blocked in China. However, Vertex AI (from Google Cloud) still seems to be available
I got a question. Can you connect it to Bluetooth after you build the chat bot and do you need any kinds of wires to run the chat and what about the Internet how do you connect it to the Internet?
That is a great project. It would be great if you could enhance i even further. For example is it possible to use better text to speech engine which does not sound like a 20 year old robot, or somehow adopt GPT to give shorter answers to make it look more like a conversation rather than pronouncing a long passage? Thank you for your efforts.
@@friedonions8955 haha that's a first time I heard this. I'm considering making an update for a more human like voice. The issue is latency because espeak (robot voice) is a synthezier and Google voice (human voice) is a conversion algorithm
Hi, exellent video, really, you have resolved 1 month of research 👍, have a question : i'm french and i need to have the text in french (not the voice, just text ) how can change that ? this happens on the side of your code, or side of openai ?
I'll Try to make this myself. I'm planning to leave everything plugged in (microphone, speaker) and hang it on a pegboard. Will the Script Start automaticly after setting it up once? I dont Plan to leave a Monitor, mouse and keyboard connected. Also, can I change the Language to german? Awesome Video, thank you!
At the moment, I don't know of anything that sounds better, but I'm working on an app to incorporate this, so potentially you will have the normal Google Voice assistant's voice for it.
So i'm making a robot. I'm thinking of using this because i have a spare pi and USB audio dongle. Can you limit the number of words in the response? Can you get other voice types like an alien?
Did you try the terminal commands recently? The first two gave me this error out of the box: ''error: externally-managed-environment '' I'm using a Pi4 and Raspberry Pi OS 64 Bookworm. Do I have to downgrade?
Not necessarily. Bookworm adopts a different approach to python so when installing anything using pip, add this to the end of the command: --break-system-packages For example: Pip3 install OpenAI --break-system-packages
Hey ! Super cool project ! There is something I might have missed... is this like a skill to add to your Mycroft, or an independent skill that you can't have along the others ?
Yep. In fact, just as long as you have any computing device that can run Python3 & has a wifi connection, you can get this working. With that said, some libraries might not work the same way, but that's something that some googling can fix. Let me know how it goes tho
Hey Thomas nice project! Currently trying to do the same. Plan is to build a phone assistent for a local store. So instead of using mic using a IVR system with a SIM card so it takes calls. Is it possible to run it in a chat mode instead of completion mode so it actually follows through the conversation? 🤖
the script can recognize what i’m saying, but i keep getting errors saying (‘Connection aborted.’, ConnectionResetError(104, ‘Connection reset by peer.’)) any ideas on how to fix it?
F1! F1! i dont get the drift . according to tips in comment, i dont get the script running. i would be pleased to get some support from you. i am using a laptop with debian 12 and ms visual studio, also in prompt as well as in env error is no installed plugins possible. best thanks, thomas too.
Is it possible to share something to the bot with a phone, like a recipe, so it can help you go step by step while cooking and you can ask questions like "what was the amount of flour in the previous step"?
Hi! Sorry for being late, but I’ve found a free, offline way. It’s called “alpaca”. Data slayer made a video on it, the description has the tutorial. It works for any operating system.
Could you help me with a part of this project? When I'm trying to run this code on my HDMI speakers, it says something about alsa error, and how it failed to start. Do you think if I downloaded pulseaudio, or used a headphone jack speaker, it would work?
Good question. From what I see, the majority of latency comes from text -> voice & the other way around. Try plugging it into your Wi-Fi router with Ethernet cable
I tried to install all the libraries. Only with PyAudio did this go wrong. Eventually, I got it to work. By the following commands:
sudo apt install libasound-dev portaudio19-dev
libportaudio2 libportaudiocpp0
After that sudo apt install ffmpeg and than run
python3 -m pip install pyaudio
Everything works great
Great! Thanks for sharing. I will 📌 this to help others
helped me a lot, thanks!
God Bless You. Thank you for taking time out of your day to comment this, you have been so helpful
Good setting
The first time I saw this video, I was intrigued, but now ChatGPT has its own speech conversation function.
It surely does
How to get chatgbt to control actual motors PLEAAAASEE😢@@thomasthemaker
Amazing work dude. Also congrats on accomplishing 100 subs. Have a great day!
- your 100th subscriber
Hey John, I appreciate that! Have yrself a good weekend!
Thanks this worked well i can now use chatgpt as a voice command to turn on the laser
Ohhh noaicee. Did it work? I wanna seee
Just came across, a totally amazing project. Perhaps the ultimate stage of this would be a bot that activates only on a certain voice command so what you chat in a room does not get sent to gpt unless you ask for this, and a real non-robotic voice of your choice. I am impressed, thank you!
Thx this is so cool your 1000th subscriber
Much appreciated 👍!
ill start my project with yours as guidance to make my own, awesome and simple. Thank you!
GENIUS! This is exactly what I was looking for, thanks!
you should just use llama2 or 3 , or any of the Local Language models , stop supporting the system they are watching us , its literally 1 command in linux to install llama2 or 3
Thanks so much for this favorite online classes.
most interesting project! didn't know raspberry pi can run chatgpt
thank you it very interesting to see somone of your age do a project like this
I have been thinking of this for a few days now ! Thanks Thomas !!
Glad to help! If you think of any more ideas let me know
Great ChatGPT chatbot! Awesome! Hi Thomas I have a Raspberry PI 5, a ollama with tinyollama setup on my system with an ollama webui as frontend. It works and the responses are good enough as far as speed is concerned. I already installed piper and the voice sounds natural and perhaps add whisper next for an all out local project. Do you know a way on how I can this all integrated together. I'll be looking forward to your next video.🌟🌟👍
Perfect, now it needs to be also a media player for spotify and other stream and be able to control home assistant devices :) Thanks
This is crazy crazy cool
Wow incredible work here!! Very inspiring!!!
When I copy and paste the libraries/dependencies code I get a externally-managed-environment error then I go into a virtual environment then do it again it works but then I get more errors stating that it can't find dotenv idk what I'm doing wrong but I followed this video to a T and nothing's working
Have you found a solution
I agree. Nothing but problems when installing the libraries. I wonder if anyone has successfully got this to work? Wasted hours of time trying to get this setup with my grandson.
The libraries will not load
Not running well, it keeps saying command not found when I type in python 3. gpt.py and I just can’t get it to run
Can you get it to control motors and LED's? I'm new to the GPT space and am seeking to make a complex arduino android controlled by types of responses. Like a wealth of animations triggered by the chat bot's reply, and the attitude it associates with it's response.
That actually sounds really cool. I would defo think about making a video on this . A gpt filter + split GPIO code into micro services will achieve this
That’s amazing! Bravo👏🏻 congrats… but is possible change the chatbot voice? For example my voice?
Superb project. Just what i was looking for.
this is awesome ive been trying to do the same project over the last week. i set up your code to use as an example for mine, but its running slow do you have any suggestions on how to speed it up? im running it on a rasp pi 4 8gb btw.
The speed of the python script depends on the speed of speech-text + API call + text-to-speech (roughly). So a better mic + a wired connection for internet is my recommendation.
Glad I could help, let me know if you have any video ideas suggestions!
That was very interesting. I have a raspberry pi 3 I think I may try this.
Glad I could help!
Bro nice project thanks for support !!
Looking forward to your next video
Awesome tutorial! 👍
Any additional or less robotic voice libraries?
There is also gTTS (by Google) but this has to connect back and forth with Google server to work so the latency of the chatGPT audio response can be worse.
@@thomasthemaker hmm 🤔
Hacksmith just did a video with similar results but broader in scope. They has a non robotic voice.
For me I can't wait for diy projects that do what Alexa was supposed to be
Hello. How can i use with Romanian Language ? On Polly it s "Emil" language and i want to use it. To ask and response in romania. Can you help me ?
@@tratzumwheres the link?
This is an awesome video, thank you!!
Glad you liked it! 😀
Wow, thanks for this video man.
I was windering, once installed, how can you install this on a rc car?
Have the system roam around with comouter vision, lidar, and other systems for obstacle avoidance, roaming around my property?
Thanks again for this informative video.
That's actually a cool idea. Watch out for a video on that!
@thomasthemaker lol dude, if you're gonna do that, go into detail on how to, coding, or share the code so I can build and install your code.
Roaming bots! Lol pretty cool to have.
Broo... U r the MANNN...
Glad this helps man! I'm about to make an even better version, so watch out for that!
Nice!!!! It is an interesting project. Thank you very much ❤
So cool!
Awesome project! Just what I've been looking for. Thanks for this!
[suggestion] Would've been better if the voice was less robotic. I think there are TTS models that does that.
That's correct, but I do see that TTS can have a significant latency. But still a great option! (GPT API already has quite some latency anyway)
@@thomasthemaker Robotic voice is AWESOME!
@@davidgibson6449 that's great to hear. Not everyone is into the robotic voice haha
Is it possible to make it sound less robotic like ?
I got it running, and its pretty slow. How do I exit back to my command line?????
I'm creating a new version with better speed. Also Ctrl + C to exit
Any chance I could buy the SD card image for the finished project off you?
Can you get gpt to interface with the io pins?
Great questions, and i think you can. and it ll teach you some good stuff.
can i input in my robot which iam making using rasperry pi 4
I will also be trying this on my robot
Hi! Could you pls make a tutorial for voice assistant that has customized responses? Thank you
This is awesome , thanks a lot , although I have not been able to make it properly run on raspberry pi zero w2 , have you tried it? It starts to listen and when triggered sometimes it works rcognizing speech sometimes it does not.
Thank you for the wonderful tutorial.
Once the VLC is executed, the file finishes playing and the Listening for 'Hey'... It does not automatically turn into. VLC doesn't seem to be ending.
is there a way to change the voice in to a more human like one?
There is if you use gTTS instead of espeak. I'm about to make a new video on that
Great video! Thanks !!
Great video Thomas! Thanks for sharing :) Could you probably provide us with some further information about how this mini microphone can be plugged in and used and what kind of speaker you connected to the Raspberry pi and how? Many thanks in advance!
I would recommend a blue ice mic! Good balance of quality and price
Thanks for your immediate response! I already bought a mini microphone similar to the one you suggested in the video but indeed the quality of it is not that good. That’s why I asked. And what about the audio output do you use a HDMI adaptor for it? Thank you once again for the nice video and keep up the great work!
@@PanosAms for audio output, HDMI should work fine
Hey thanks for the great vid and does this chatbot understand and speak Chinese?
I'm afraid not, just not right now
Muchas gracias
Great job
Hey thanks for the good words! I appreciate that
I actually think it is pretty cool man.Can you tell me where we have to plug in the microphone and can the we use a Bluetooth speaker for the speaker
Does it need wifi
Excelente su video. Disculpa la pregunta se puede trabajar la IA CHATGPT sin estar inscrito o se debe tener un registro para poder realziar la aplicación de CHATBOT
Unfortunately you do need to have an OpenAI account & API to do that
Do you know how to change the voice, it would be good to change the voice to a famous voice clone, a movie star you love or a tv robot maybe even a star wars actor, first need to be able to clone the voice and I know there is a website that can do this but not sure about any of the rest of the process to make it work. If you do know how a video would be awesome, I loved this video, thank you.
Thank you for this!!! Do you know if/ how it’s possible to change how the voice sounds?
I'm guessing he used the pyttsx3 module (havent taken a look at the code), which uses the operating system's built in text to speech technology. You could try using openai's tts model, but that would be more code and an extra cost. I *have* however, opted to use it for many personal projects.
Hey! Thank you very much for ur video! But pls tell me if there is a way to change the voice of the thing?
Eleven labs
Hello,How to ensure stable access to the chatgpt api in China? Recently, v2ray was used, but it is unstable
I'm not super familiar with the China networking & v2ray but it does seem like most ai model APIs are blocked in China.
However, Vertex AI (from Google Cloud) still seems to be available
@@thomasthemaker Thank you!
i have connected my speaker via AUX cable to the Pi and connected a MIC via USB, can u please share what changes i need to do in code to make it work?
How to avoid hard coding API key. Suppose I want to give this device to someone else?
You can have exclusive API for each person so if they use it maliciously, they get charged for it fully
What to do at 4:48 ?? After the key is written what should we do next with the code
I got a question. Can you connect it to Bluetooth after you build the chat bot and do you need any kinds of wires to run the chat and what about the Internet how do you connect it to the Internet?
This may be a silly question but I have a aibo ers1000 dog and would like to put ChatGPT into it, is there a way I could do this?
Actually, this is pretty amazing! What do you suggest as a energy source to run the rasp unplugged?
I would say a solar power source + battery would be a good choice (15-20W should be enough).
I setting this project in my raspi but i say Hey
nothing happens what the problem??? pls help me
very nice 🔥🔥🔥
Can we use laptop default speaker instead of microphone?
That is a great project. It would be great if you could enhance i even further. For example is it possible to use better text to speech engine which does not sound like a 20 year old robot, or somehow adopt GPT to give shorter answers to make it look more like a conversation rather than pronouncing a long passage? Thank you for your efforts.
That's a really good feedback, the next version will have those improvements for sure! Thank you!
Honestly, I prefer the robotic voice. It gives itself personality!
@@friedonions8955 haha that's a first time I heard this. I'm considering making an update for a more human like voice. The issue is latency because espeak (robot voice) is a synthezier and Google voice (human voice) is a conversion algorithm
can you change the language?
in your github repo you have shared , can you please add requirements.txt file ?
This was pretty cool, also goo to know about the cost and $5 credit, thanks!
Yep, even without the 5$ credit, the API is wildly cheap for normal use (not costing more than 10$/yr)
can you change the voice? or use other text-to-speech services.
Can we use Bluetooth earphone with mic instead of mini microphone?
We can directly connect using Bluetooth.
Will it work?
Thomas will you help me for build iot monitoring system co2, humidity and temperature. Using raspberry pi 3b+, mg811 sensor and dht22 sensor
What's the problem you're having?
reading co2 did not have a value and i did not know how to connect to blynk 2.0, will give your others sns for me dm you@@thomasthemaker
Hi, exellent video, really, you have resolved 1 month of research 👍, have a question : i'm french and i need to have the text in french (not the voice, just text ) how can change that ?
this happens on the side of your code, or side of openai ?
I would say mostly on the GPT side.
I'll Try to make this myself. I'm planning to leave everything plugged in (microphone, speaker) and hang it on a pegboard. Will the Script Start automaticly after setting it up once? I dont Plan to leave a Monitor, mouse and keyboard connected. Also, can I change the Language to german?
Awesome Video, thank you!
Hi can i do in Spanish language? Please is for a university project. Thanks so much !
Thank u! Really awsome ! But can't I change the voice ? Ik u said it could be worse with gTTs but isn't there an another solution?
At the moment, I don't know of anything that sounds better, but I'm working on an app to incorporate this, so potentially you will have the normal Google Voice assistant's voice for it.
wonderful!
Is it possible to do this on pico or any other raspberry pi?
Not on the pico ( it's a microcontroller) but on any other single board computers yes
Nice bro🔥🔥🔥🔥🔥✌️
So i'm making a robot. I'm thinking of using this because i have a spare pi and USB audio dongle. Can you limit the number of words in the response? Can you get other voice types like an alien?
Did you try the terminal commands recently? The first two gave me this error out of the box: ''error: externally-managed-environment
'' I'm using a Pi4 and Raspberry Pi OS 64 Bookworm. Do I have to downgrade?
Not necessarily.
Bookworm adopts a different approach to python so when installing anything using pip, add this to the end of the command:
--break-system-packages
For example:
Pip3 install OpenAI --break-system-packages
Awesome!
Does this support other languages!
Yes, I believe the API key is universal, I would recommend Go, C or Dart (maybe even JS) if you wanna go with something else
Hey ! Super cool project ! There is something I might have missed... is this like a skill to add to your Mycroft, or an independent skill that you can't have along the others ?
I think you can certainly replicate this with MyCroft. But I haven't tried it tho
Hi 👋 one question, would this work as well on an Orange pi and their Ubuntu version ?
Yep. In fact, just as long as you have any computing device that can run Python3 & has a wifi connection, you can get this working. With that said, some libraries might not work the same way, but that's something that some googling can fix. Let me know how it goes tho
@@thomasthemaker thank you very much I will🙏
Hey this is amazing! but how can I plug my computer monitor keyboard and Mose into the device
mouse
You can run it locally on your raspberry pi terminal when plugged into a screen if you like.
I SSH this way primarily for the simplicity aspect
Hey Thomas nice project! Currently trying to do the same. Plan is to build a phone assistent for a local store. So instead of using mic using a IVR system with a SIM card so it takes calls. Is it possible to run it in a chat mode instead of completion mode so it actually follows through the conversation? 🤖
Yes you can actually
@@thomasthemakerhow
the script can recognize what i’m saying, but i keep getting errors saying (‘Connection aborted.’, ConnectionResetError(104, ‘Connection reset by peer.’))
any ideas on how to fix it?
and how to change the sound
Does like any usb michrophone work? like a desktop michrophone
Most should work!
Interesting!!!
Thank you!
Hey thomas,
How do i change the voice accent of this one?
Machine spirit
is there any way to use text to speach ai generators to improve the speech voice?
You certainly can do that with OpenAI api
F1! F1! i dont get the drift . according to tips in comment, i dont get the script running. i would be pleased to get some support from you. i am using a laptop with debian 12 and ms visual studio, also in prompt as well as in env error is no installed plugins possible. best thanks, thomas too.
OH and i also wanted to know if the usb microphone worked?
Apparently not very well due to it's being bad. You can get a USB office mic or like a Blue Snow mic, that will work much better
@@thomasthemaker oh okay i see
Is it possible to share something to the bot with a phone, like a recipe, so it can help you go step by step while cooking and you can ask questions like "what was the amount of flour in the previous step"?
It is possible if you use something like autogen or code interpreter running also on the PI
Hı ı have a problem aboute price account ı dont want to start price account so can you show me free way or different ı wait to your solves
Hi! Sorry for being late, but I’ve found a free, offline way. It’s called “alpaca”. Data slayer made a video on it, the description has the tutorial. It works for any operating system.
how to change the wake up word brother
You can change it in the code
can we add a database to this so it can recall charters and town like a link in a video game with keywords like make a town make a npc
I suppose you can, it's a very simple function to implement, so yes
Could you help me with a part of this project? When I'm trying to run this code on my HDMI speakers, it says something about alsa error, and how it failed to start. Do you think if I downloaded pulseaudio, or used a headphone jack speaker, it would work?
ALSO: What kind of speaker do you use? Can you please give me the link to buy it? Thanks
could we get in contact so you can help me with the rasberry pi prolems?
can you make in windows
How can you improve the lag time between the command and answer, like alexa or a google device?
Good question. From what I see, the majority of latency comes from text -> voice & the other way around. Try plugging it into your Wi-Fi router with Ethernet cable
And you could also use OpenAI whisper or ElevenLab to see if it is any better
@@thomasthemaker unfortunately not an option on the robot im building. The latency cant be that bad.
Do you connect microphone to laptop usb or raspberry Pi usb?
Raspberry Pi USB was what I used