Это видео недоступно.
Сожалеем об этом.

ChatGPT + Raspberry Pi - A ChatGPT powered Raspberry Pi chatbot

Поделиться
HTML-код
  • Опубликовано: 17 авг 2024
  • A beginner-friendly way to combine Chat GPT & Raspberry Pi.
    0:00 Building
    5:36 Demo Chatbot
    Note: if you are using my GitHub repo, use the file chatgpt_voice.py ( not chatgpt_voice2.py)
    Guide:
    Microphone: www.amazon.com...
    Create OpenAI ChatGPT API at: openai.com/
    Terminal commands:
    1. Installing libraries/dependencies
    sudo apt update
    sudo apt upgrade
    python3 -m pip install python-dotenv
    pip3 install openai dotenv SpeechRecognition pyttsx3 gtts PyAudio
    sudo apt install python3-pyaudio flac python3-espeak espeak python3-dotenv
    pip uninstall dotenv
    pip install python-dotenv
    *Change audio to HDMI
    2. Python script
    Github repo: github.com/Tho...
    Python script:
    import os
    import openai
    from dotenv import load_dotenv
    import time
    import speech_recognition as sr
    import pyttsx3
    import numpy as np
    from gtts import gTTS
    mytext = 'Welcome to me'
    language = 'en'
    from os.path import join, dirname
    import matplotlib.pyplot as plt
    ^ matplotlib is great for visualising data and for testing purposes but usually not needed for production
    openai.api_key=''
    load_dotenv()
    model = 'gpt-3.5-turbo'
    Set up the speech recognition and text-to-speech engines
    r = sr.Recognizer()
    engine = pyttsx3.init("dummy")
    voice = engine.getProperty('voices')[1]
    engine.setProperty('voice', voice.id)
    name = "YOUR NAME HERE"
    greetings = [f"whats up master {name}",
    "yeah?",
    "Well, hello there, Master of Puns and Jokes - how's it going today?",
    f"Ahoy there, Captain {name}! How's the ship sailing?",
    f"Bonjour, Monsieur {name}! Comment ça va? Wait, why the hell am I speaking French?" ]
    Listen for the wake word "hey pos"
    def listen_for_wake_word(source):
    print("Listening for 'Hey'...")
    while True:
    audio = r.listen(source)
    try:
    text = r.recognize_google(audio)
    if "hey" in text.lower():
    print("Wake word detected.")
    engine.say(np.random.choice(greetings))
    engine.runAndWait()
    listen_and_respond(source)
    break
    except sr.UnknownValueError:
    pass
    Listen for input and respond with OpenAI API
    def listen_and_respond(source):
    print("Listening...")
    while True:
    audio = r.listen(source)
    try:
    text = r.recognize_google(audio)
    print(f"You said: {text}")
    if not text:
    continue
    Send input to OpenAI API
    response = openai.ChatCompletion.create(model="gpt-3.5-turbo", messages=[{"role": "user", "content": f"{text}"}])
    response_text = response.choices[0].message.content
    print(response_text)
    #myobj = gTTS(text = response_text, lang = language, slow = False)
    #myobj.save("test.wav")
    #os.system("aplay test.wav")
    Speak the response
    print("speaking")
    os.system("espeak ' "+response_text + "'")
    engine.say(response_text)
    engine.runAndWait()
    if not audio:
    listen_for_wake_word(source)
    except sr.UnknownValueError:
    time.sleep(2)
    print("Silence found, shutting up, listening...")
    listen_for_wake_word(source)
    break
    except sr.RequestError as e:
    print(f"Could not request results; {e}")
    engine.say(f"Could not request results; {e}")
    engine.runAndWait()
    listen_for_wake_word(source)
    break
    Use the default microphone as the audio source
    with sr.Microphone() as source:
    listen_for_wake_word(source)

Комментарии • 400

  • @geoffreygeo6385
    @geoffreygeo6385 Месяц назад +8

    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

    • @thomasthemaker
      @thomasthemaker  Месяц назад

      Great! Thanks for sharing. I will 📌 this to help others

    • @theredditemperor8806
      @theredditemperor8806 Месяц назад

      helped me a lot, thanks!

    • @CarlosHernandez-yt5so
      @CarlosHernandez-yt5so 19 дней назад +1

      God Bless You. Thank you for taking time out of your day to comment this, you have been so helpful

  • @alexpapou4806
    @alexpapou4806 Месяц назад +1

    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!

  • @lzcell9727
    @lzcell9727 5 месяцев назад +2

    The first time I saw this video, I was intrigued, but now ChatGPT has its own speech conversation function.

    • @thomasthemaker
      @thomasthemaker  5 месяцев назад

      It surely does

    • @mq-r3apz291
      @mq-r3apz291 5 месяцев назад

      How to get chatgbt to control actual motors PLEAAAASEE😢​@@thomasthemaker

  • @JohnDoe-og9kz
    @JohnDoe-og9kz Год назад +7

    Amazing work dude. Also congrats on accomplishing 100 subs. Have a great day!
    - your 100th subscriber

    • @thomasthemaker
      @thomasthemaker  Год назад +2

      Hey John, I appreciate that! Have yrself a good weekend!

  • @WINTERMUTE_AI
    @WINTERMUTE_AI Год назад +7

    GENIUS! This is exactly what I was looking for, thanks!

    • @unkillablespirits8582
      @unkillablespirits8582 3 месяца назад

      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

  • @charlesmarchand9098
    @charlesmarchand9098 11 месяцев назад +4

    ill start my project with yours as guidance to make my own, awesome and simple. Thank you!

  • @drewski6843
    @drewski6843 Месяц назад +2

    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
      @thomasthemaker  16 дней назад

      That's actually a cool idea. Watch out for a video on that!

    • @drewski6843
      @drewski6843 16 дней назад

      ​@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.

  • @betrayedsoul47
    @betrayedsoul47 6 месяцев назад +3

    Thx this is so cool your 1000th subscriber

  • @jtr1227
    @jtr1227 Месяц назад +1

    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.🌟🌟👍

  • @TheCryptoCollective69
    @TheCryptoCollective69 9 месяцев назад +3

    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

  • @jacquesdupontd
    @jacquesdupontd 2 месяца назад

    Perfect, now it needs to be also a media player for spotify and other stream and be able to control home assistant devices :) Thanks

  • @davyponte
    @davyponte 9 месяцев назад +1

    That’s amazing! Bravo👏🏻 congrats… but is possible change the chatbot voice? For example my voice?

  • @mercy1441
    @mercy1441 Год назад

    I have been thinking of this for a few days now ! Thanks Thomas !!

    • @thomasthemaker
      @thomasthemaker  Год назад

      Glad to help! If you think of any more ideas let me know

  • @Vimal739
    @Vimal739 Месяц назад

    So cool!

  • @johnmatheson9462
    @johnmatheson9462 Год назад +7

    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.

    • @thomasthemaker
      @thomasthemaker  Год назад +3

      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.

    • @thomasthemaker
      @thomasthemaker  Год назад +2

      Glad I could help, let me know if you have any video ideas suggestions!

  • @carterkraber6784
    @carterkraber6784 2 месяца назад +1

    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

  • @user-pi1lq3pj
    @user-pi1lq3pj Год назад

    thank you it very interesting to see somone of your age do a project like this

  • @Kataroobungaloo
    @Kataroobungaloo 5 месяцев назад

    Wow incredible work here!! Very inspiring!!!

  • @user-iq9zc9ck6f
    @user-iq9zc9ck6f 4 месяца назад +1

    Hello,How to ensure stable access to the chatgpt api in China? Recently, v2ray was used, but it is unstable

    • @thomasthemaker
      @thomasthemaker  4 месяца назад

      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

    • @user-iq9zc9ck6f
      @user-iq9zc9ck6f 4 месяца назад

      @@thomasthemaker Thank you!

  • @markboweringphotography4408
    @markboweringphotography4408 11 месяцев назад

    Superb project. Just what i was looking for.

  • @3dStudioPrinting
    @3dStudioPrinting 4 месяца назад +1

    Is it possible to make it sound less robotic like ?

  • @nhunglehong3117
    @nhunglehong3117 10 месяцев назад

    Nice!!!! It is an interesting project. Thank you very much ❤

  • @nastynoah
    @nastynoah Год назад +1

    I got it running, and its pretty slow. How do I exit back to my command line?????

    • @thomasthemaker
      @thomasthemaker  Год назад

      I'm creating a new version with better speed. Also Ctrl + C to exit

  • @jasonmcnabb3218
    @jasonmcnabb3218 3 месяца назад +2

    The libraries will not load

  • @colemanandersen
    @colemanandersen Месяц назад

    This is an awesome video, thank you!!

  • @solodagci
    @solodagci 5 месяцев назад

    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?

    • @thomasthemaker
      @thomasthemaker  5 месяцев назад +1

      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

  • @elvenkim
    @elvenkim 8 месяцев назад

    most interesting project! didn't know raspberry pi can run chatgpt

  • @K2000-d5q
    @K2000-d5q 11 месяцев назад

    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 ?

    • @thomasthemaker
      @thomasthemaker  11 месяцев назад

      I think you can certainly replicate this with MyCroft. But I haven't tried it tho

  • @jupiterjs031
    @jupiterjs031 10 месяцев назад

    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.

  • @jrrisra
    @jrrisra 11 месяцев назад +4

    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.

    • @thomasthemaker
      @thomasthemaker  7 месяцев назад +2

      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)

    • @davidgibson6449
      @davidgibson6449 2 месяца назад

      @@thomasthemaker Robotic voice is AWESOME!

    • @thomasthemaker
      @thomasthemaker  2 месяца назад

      @@davidgibson6449 that's great to hear. Not everyone is into the robotic voice haha

  • @zhangxiang18
    @zhangxiang18 Год назад +1

    Hey thanks for the great vid and does this chatbot understand and speak Chinese?

  • @kunalshah912
    @kunalshah912 3 месяца назад

    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?

  • @mikew2883
    @mikew2883 5 месяцев назад

    Awesome tutorial! 👍

  • @georgekot6377
    @georgekot6377 11 месяцев назад

    Looking forward to your next video

  • @mytube1000javed
    @mytube1000javed 6 месяцев назад +1

    How to avoid hard coding API key. Suppose I want to give this device to someone else?

    • @thomasthemaker
      @thomasthemaker  6 месяцев назад

      You can have exclusive API for each person so if they use it maliciously, they get charged for it fully

  • @user-lc3yp3pj6j
    @user-lc3yp3pj6j 5 месяцев назад

    Bro nice project thanks for support !!

  • @user-mk4ej1zc3p
    @user-mk4ej1zc3p 10 месяцев назад +1

    can i input in my robot which iam making using rasperry pi 4

    • @np1663
      @np1663 7 месяцев назад

      I will also be trying this on my robot

  • @panagiotischasapopoulos243
    @panagiotischasapopoulos243 6 месяцев назад

    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!

    • @thomasthemaker
      @thomasthemaker  6 месяцев назад

      I would recommend a blue ice mic! Good balance of quality and price

    • @panagiotischasapopoulos243
      @panagiotischasapopoulos243 6 месяцев назад

      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!

    • @thomasthemaker
      @thomasthemaker  6 месяцев назад

      @@panagiotischasapopoulos243 for audio output, HDMI should work fine

  • @DeathTempler
    @DeathTempler Год назад +2

    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.

    • @thomasthemaker
      @thomasthemaker  Год назад

      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

  • @borisai
    @borisai 8 месяцев назад

    Actually, this is pretty amazing! What do you suggest as a energy source to run the rasp unplugged?

    • @thomasthemaker
      @thomasthemaker  8 месяцев назад

      I would say a solar power source + battery would be a good choice (15-20W should be enough).

  • @aldhenfrancisco9643
    @aldhenfrancisco9643 6 месяцев назад

    Hi! Could you pls make a tutorial for voice assistant that has customized responses? Thank you

  • @mohdismailmohtar5179
    @mohdismailmohtar5179 Год назад +1

    Broo... U r the MANNN...

    • @thomasthemaker
      @thomasthemaker  Год назад

      Glad this helps man! I'm about to make an even better version, so watch out for that!

  • @ismaelperegrina8201
    @ismaelperegrina8201 6 месяцев назад

    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.

  • @hervan2011
    @hervan2011 7 месяцев назад

    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

    • @thomasthemaker
      @thomasthemaker  7 месяцев назад

      Unfortunately you do need to have an OpenAI account & API to do that

  • @AhmadAnsarMe
    @AhmadAnsarMe 3 месяца назад

    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?

  • @Aries29ah
    @Aries29ah 10 месяцев назад +1

    Any chance I could buy the SD card image for the finished project off you?

  • @Enchatèmção
    @Enchatèmção 9 месяцев назад +1

    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

  • @user-lc3yp3pj6j
    @user-lc3yp3pj6j 5 месяцев назад

    Can we use Bluetooth earphone with mic instead of mini microphone?
    We can directly connect using Bluetooth.
    Will it work?

  • @iron_ott7156
    @iron_ott7156 Год назад +2

    is there a way to change the voice in to a more human like one?

    • @thomasthemaker
      @thomasthemaker  Год назад +1

      There is if you use gTTS instead of espeak. I'm about to make a new video on that

  • @dapperroag
    @dapperroag 9 месяцев назад

    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?

  • @okancan8191
    @okancan8191 11 месяцев назад +1

    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

    • @IPUTCROISSANTSINBLENDERS
      @IPUTCROISSANTSINBLENDERS 6 месяцев назад

      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.

  • @aligumble3666
    @aligumble3666 8 месяцев назад

    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!

  • @richardshalla
    @richardshalla 4 месяца назад

    That was very interesting. I have a raspberry pi 3 I think I may try this.

  • @kravengamerz3961
    @kravengamerz3961 4 месяца назад

    What to do at 4:48 ?? After the key is written what should we do next with the code

  • @brandonwideman2570
    @brandonwideman2570 7 месяцев назад

    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?

  • @dmitriychervonenko2953
    @dmitriychervonenko2953 Год назад +3

    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.

    • @thomasthemaker
      @thomasthemaker  Год назад +2

      That's a really good feedback, the next version will have those improvements for sure! Thank you!

    • @friedonions8955
      @friedonions8955 11 месяцев назад

      Honestly, I prefer the robotic voice. It gives itself personality!

    • @thomasthemaker
      @thomasthemaker  11 месяцев назад +1

      @@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

  • @nidzdotnet76
    @nidzdotnet76 3 месяца назад

    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?

  • @MrLartisterouge
    @MrLartisterouge Год назад

    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 ?

  • @anhquangnguyen620
    @anhquangnguyen620 6 месяцев назад

    Sau khi mình copy code vào mục sudo nano gpt.python thì làm gì nữa vậy a e đến bước này mà không làm đc nữa

    • @thomasthemaker
      @thomasthemaker  6 месяцев назад

      Xong rồi chạy code thôi em: python3 gpt.py

    • @anhquangnguyen620
      @anhquangnguyen620 6 месяцев назад

      Ok anh e làm đc rồi ạ. Thankyou anh mà trong phần mô tả, phần code để dán vào thư mục í, dòng 12-13-14 thiếu dấu # ở đầu nên bị lỗi e ktra mãi mới thấy :((

  • @hilmanafiq3627
    @hilmanafiq3627 Год назад

    Great video! Thanks !!

  • @tenyimbright
    @tenyimbright Год назад

    One possible way to rewrite your sentence is:
    Hello, you make coding look so easy. Is it possible to use more than one AI platform at the same time?

    • @thomasthemaker
      @thomasthemaker  Год назад

      can you rephrase the question by any chance?

  • @squirralien1863
    @squirralien1863 5 месяцев назад

    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.

  • @djshortt3785
    @djshortt3785 3 месяца назад

    this is really an amazing project. I'm using it and crediting you in my cyber software and components class.. One question, everything works fine until i try to say hey. The code will not progress past "Listening for 'Hey'..". made sure that speakers and audio work. would you happen to know what the problem could be? ive been researching for answers and cant seem to find the fix.

    • @thomasthemaker
      @thomasthemaker  3 месяца назад

      Hey there! I appreciate the credit.
      It can be frustrating when things don't work. To test out the microphone, you can follow this link:
      linuxconfig.org/how-to-test-microphone-with-audio-linux-sound-architecture-alsa
      Hopefully that solves it. If not, feel free to let me know!

    • @djshortt3785
      @djshortt3785 3 месяца назад

      @@thomasthemaker got it to work!!! thank you so much for this!!!!

    • @thomasthemaker
      @thomasthemaker  3 месяца назад

      @@djshortt3785 glad it worked! Did you have to shout louder?

  • @user-hl5nd5uv9j
    @user-hl5nd5uv9j 8 месяцев назад

    I had this error /usr/bin/python3: can't find '__main__' module in '/home/Tah213/gpt2.py'

  • @Cartman-TV
    @Cartman-TV 2 месяца назад

    great 😁 but can you change the voice? It sounds like Dr. Spidso from the 1990 🙃

    • @thomasthemaker
      @thomasthemaker  Месяц назад

      Haha, imma try. But if you try first!
      -nudging you to tinker-

  • @neuralgarden
    @neuralgarden 3 месяца назад

    Incredible work, but is there anyway to do a different voice?

  • @snoebix5125
    @snoebix5125 7 дней назад

    So getting a key is free ?

  • @FarazKhan-dm9bw
    @FarazKhan-dm9bw Месяц назад

    Hello brother I liked your project. But I have a question. Can I use a raspberry pi 3a+ to make this ???? Please respond quickly brother. You got a new sub

  • @Wodawic
    @Wodawic Год назад +4

    Any additional or less robotic voice libraries?

    • @thomasthemaker
      @thomasthemaker  Год назад +3

      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.

    • @huibert_devet
      @huibert_devet Год назад

      @@thomasthemaker hmm 🤔

    • @tratzum
      @tratzum Год назад

      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

    • @dacianfd8418
      @dacianfd8418 Год назад

      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 ?

    • @michaeltomilobamfon3433
      @michaeltomilobamfon3433 11 месяцев назад

      @@tratzumwheres the link?

  • @andreafreeman6396
    @andreafreeman6396 8 месяцев назад

    Thank you for this!!! Do you know if/ how it’s possible to change how the voice sounds?

    • @zayanarshad88
      @zayanarshad88 6 месяцев назад

      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.

  • @antonkirchner6900
    @antonkirchner6900 Год назад +1

    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? 🤖

  • @brayanrayan4853
    @brayanrayan4853 5 месяцев назад

    Hi can i do in Spanish language? Please is for a university project. Thanks so much !

  • @justarandomguy564
    @justarandomguy564 5 месяцев назад

    i have a small doubt .the thing is the voice of the ai is like robotic can u try to integrate a voice in it . also the answer it gives is pretty big .can u try to shorten it a bit . i love ur work .i appreciate it soo much if u respond cause ive got a project . pls do respond

    • @thomasthemaker
      @thomasthemaker  5 месяцев назад +1

      I believe there is a parameter for that in how you use the OpenAI library in python, try reading into the documentation! Lemme know if you have any issues

    • @justarandomguy564
      @justarandomguy564 5 месяцев назад

      ​@@thomasthemakerthere is a parameter in openai docs to limit the no. of charactar in the text .but the robotic voice is something which is purely based on the OS that we are using idk how to rectify it ...

    • @thomasthemaker
      @thomasthemaker  5 месяцев назад

      @@justarandomguy564 you can also use OpenAI text to voice. At the time of me making the video, this was not very stable. But currently, I highly recommend it. It's quite better than the typical Google Voice API.
      There should also be another version of the python script in my GitHub. Take a look at that!

  • @henryhancock7396
    @henryhancock7396 10 месяцев назад +2

    Can you get gpt to interface with the io pins?

    • @nonchalant_morocco
      @nonchalant_morocco 6 месяцев назад +1

      Great questions, and i think you can. and it ll teach you some good stuff.

  • @huibert_devet
    @huibert_devet Год назад +1

    hey 😉, Greetings from far Germany,
    I use a iMac, can I use the same code? And is a more pleasant voice possible? Does a paid account make more sense for better reaction time? Those are my three tiny questions 😇.
    Good luck and success for your channel. You have my subscription :)

    • @huibert_devet
      @huibert_devet Год назад

      my voice question is already answered 😎

    • @thomasthemaker
      @thomasthemaker  Год назад

      If you don't mind, can you share how you resolved this? Did you pay for some voice model?

    • @huibert_devet
      @huibert_devet Год назад

      Sorry ... I wish I could have help you
      BUT ... if you want to look two German YT about the same issue.
      This might be useful for you. They have used much better voices :)
      and there used also free variants for the voice ...
      they have build extra devices for in and output, but of course this is optional
      ruclips.net/video/7mR_bGLNRb4/видео.html
      ruclips.net/video/IeizgjXoxVc/видео.html

  • @SwiftShadow887
    @SwiftShadow887 4 месяца назад

    can you change the voice? or use other text-to-speech services.

  • @onkarbatra9884
    @onkarbatra9884 Год назад

    Great! Did you faced any problems with the script recognizing wake-word? I've been trying for hours now. Any suggestions?

    • @thomasthemaker
      @thomasthemaker  Год назад

      I did actually, there's a latency at every step. I would recommend trying a better mic, when I did that, the number of trials come down from 12 to 2

    • @ismaelperegrina8201
      @ismaelperegrina8201 6 месяцев назад

      @@thomasthemaker Jisus Crais , so is that difficult to make the mic work properly?

  • @user-lc3yp3pj6j
    @user-lc3yp3pj6j 5 месяцев назад

    Can we use laptop default speaker instead of microphone?

  • @oscarburr11
    @oscarburr11 5 месяцев назад

    i have an error saying i exceed my current quota, and now i can't even use chatgpt it just doesnt let me?

    • @thomasthemaker
      @thomasthemaker  5 месяцев назад

      You might need to get to your OpenAI account and put some dollars in it. 5$ is enough for a longggg time

    • @oscarburr11
      @oscarburr11 5 месяцев назад

      @@thomasthemaker my apologies mate! i thought that everyone got 5 dollars. It now doesn't give me that error, but it stops at "listening for hey" and doesn't respond. My microphone is working, i tested it with "arecord test.wav" and you could hear my voice perfectly fine

    • @oscarburr11
      @oscarburr11 5 месяцев назад

      @@thomasthemaker thanks mate - i thought they give you £5! Silly me. However now I'm getting lots of errors before it says "listening for hey" which indicate an issue between audio devices. I have it set to record via my webcam audio (not ideal, but I can tell that the Pi can hear me because i used the arecord test.wav command and the audio file recorded my voice perfectly.

    • @thomasthemaker
      @thomasthemaker  5 месяцев назад

      @@oscarburr11 no yr not silly at all! At the time I was making the video, they would give out 5$ for everyone (for like 6 months). Sadly it's not the case anymore though.
      The "listening for hey" basically means "hey" is not recognized yet, might be a bad mic or gotta speak louder

    • @oscarburr11
      @oscarburr11 5 месяцев назад

      @@thomasthemaker i tried my bluetooth with your updated version and the lady responded but then i got:
      Yes, I can hear you. How can I assist you today?
      generating audio
      speaking
      VLC media player 3.0.20 Vetinari (revision 3.0.20-0-g6f0d0ab126b)
      [000000557046e560] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
      QStandardPaths: wrong permissions on runtime directory /run/user/1000, 0770 instead of 0700
      QStandardPaths: wrong permissions on runtime directory /run/user/1000, 0770 instead of 0700

  • @user-dv8dt9yw5b
    @user-dv8dt9yw5b Год назад

    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?

    • @thomasthemaker
      @thomasthemaker  Год назад +2

      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.

  • @yorutamashi
    @yorutamashi 8 месяцев назад

    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"?

    • @ismaelperegrina8201
      @ismaelperegrina8201 6 месяцев назад

      It is possible if you use something like autogen or code interpreter running also on the PI

  • @mahdizayet4011
    @mahdizayet4011 9 месяцев назад

    very nice 🔥🔥🔥

  • @mozbeat2162
    @mozbeat2162 Год назад

    Hi I tryed this today on my mac but the script dont react to any sound. Probably because its not connectet to my mic but in the audio settings isnt a hdmi devise like you showed

    • @thomasthemaker
      @thomasthemaker  Год назад

      Let's run through some simple debugging.
      1. Did it pick up your voice? If not, has to be the code not picking up the right mic.If so, move on.
      2. Is it printing out the response in the terminal? If not, the API and/or wifi is not working. If yes, move on.
      3. In this case, there can only be the python script not outputting to the right speaker.
      Let me know if this helps

  • @drevil1168
    @drevil1168 Год назад +1

    Hi 👋 one question, would this work as well on an Orange pi and their Ubuntu version ?

    • @thomasthemaker
      @thomasthemaker  Год назад +2

      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

    • @drevil1168
      @drevil1168 Год назад +2

      @@thomasthemaker thank you very much I will🙏

  • @SAM-hb6mn
    @SAM-hb6mn 5 месяцев назад

    bro the code an't coding it is saying this module is not availiable now

  • @hameedakinwunmi832
    @hameedakinwunmi832 7 месяцев назад

    Good evening I was able to follow your instructions till the end. Unfortunately for me when I run the code I get an import error message that says can’t import load_dotenv from dotenv I’ve deleted and reinstalled dotenv but I still get the error any do you have any ideas as to how to fix this?

    • @thomasthemaker
      @thomasthemaker  7 месяцев назад

      Try "sudo apt" also not just pip, that might work

  • @user-be9ro5xv2t
    @user-be9ro5xv2t 6 месяцев назад

    I am using a USB headset with a microphone on a Raspberry Pi 4b. I tried every step accordingly but my voice is not captured by the code. I checked my microphone and it is working fine. The code is just stuck at "Listening for "Hey" ... Any solution?

    • @thomasthemaker
      @thomasthemaker  6 месяцев назад

      Check for audio source, make sure it's pointing to your headset

    • @user-be9ro5xv2t
      @user-be9ro5xv2t 6 месяцев назад

      @@thomasthemaker Thanks for your response! The audio source is set to my headset, also I made sure that the headset mic and speaker are set to default. The headset works fine with other applications, just the speech_recognition function is not working...

    • @thomasthemaker
      @thomasthemaker  6 месяцев назад

      @@user-be9ro5xv2t hmm try with arecord & aplay in the terminal and see if that works.
      Sometimes you might need to wait a few seconds for the translation voice ->text

  • @alex595659
    @alex595659 Год назад

    Great job

    • @thomasthemaker
      @thomasthemaker  Год назад

      Hey thanks for the good words! I appreciate that

  • @tejashavsingh5553
    @tejashavsingh5553 8 месяцев назад

    hey man nice video but i am unable to run these command python3 -m pip install python-dotenv
    pip3 install openai dotenv SpeechRecognition pyttsx3 gtts PyAudio
    sudo apt install python3-pyaudio flac python3-espeak espeak python3-dotenv
    pip uninstall dotenv
    pip install python-dotenv every time i run these an error pop up that device in not root (something like that ) please help

  • @hervan2011
    @hervan2011 7 месяцев назад

    Muchas gracias

  • @dorimeemirod8124
    @dorimeemirod8124 7 месяцев назад

    3:44 doesn't work:
    error: externally-managed-environment
    update worked
    upgrade worked (but there where no upgrades available)
    can you help me?

    • @thomasthemaker
      @thomasthemaker  7 месяцев назад

      You must be using a newer RPi OS with python 3.11(kinda annoying to work with).
      When installing libraries, there should be an error with prompt to run with "-break sth sth".
      Run the library installation with that at the end again and it should bypass the managed environment

    • @dorimeemirod8124
      @dorimeemirod8124 7 месяцев назад

      ​@@thomasthemaker Thanks for the quick reply. that worked so far.
      Unfortunately I still have a problem.
      At 5:00: no such file or directory
      Do I have to save the script manually after copying it in?

    • @thomasthemaker
      @thomasthemaker  7 месяцев назад

      @@dorimeemirod8124 maybe. Just make sure that you're in the right folder in your terminal. Run "ls" to make sure the file is in there

    • @dorimeemirod8124
      @dorimeemirod8124 7 месяцев назад

      @@thomasthemakersorry i dont understand. i think i have to do something after 4:50.

  • @user-ps9gq4jn9r
    @user-ps9gq4jn9r 5 месяцев назад

    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?

    • @user-ps9gq4jn9r
      @user-ps9gq4jn9r 5 месяцев назад

      ALSO: What kind of speaker do you use? Can you please give me the link to buy it? Thanks

    • @user-ps9gq4jn9r
      @user-ps9gq4jn9r 5 месяцев назад

      could we get in contact so you can help me with the rasberry pi prolems?

  • @markboweringphotography4408
    @markboweringphotography4408 11 месяцев назад

    I get the following error when trying to Pip3 install the PyAudi:
    ERROR: Could not build wheels for PyAudio
    Any ideas?

    • @thomasthemaker
      @thomasthemaker  11 месяцев назад

      I would recommend running this
      pip3 install --upgrade pip3 setuptools wheel
      Or simply
      Pip3 install wheel

  • @GuillermoTs
    @GuillermoTs 5 месяцев назад

    What is the difference from use a web browser?

    • @thomasthemaker
      @thomasthemaker  5 месяцев назад

      It's like using Google voice on yr phone vs using a Google home mini. It's quite different

  • @Galaxy-Knight
    @Galaxy-Knight 11 месяцев назад

    Very cool !Can it support other languages? I would like to have a conversation with him in Chinese.

  • @marveloushaziq
    @marveloushaziq 9 месяцев назад

    Thomas will you help me for build iot monitoring system co2, humidity and temperature. Using raspberry pi 3b+, mg811 sensor and dht22 sensor

    • @thomasthemaker
      @thomasthemaker  9 месяцев назад

      What's the problem you're having?

    • @marveloushaziq
      @marveloushaziq 9 месяцев назад

      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

  • @thewonkusisback9592
    @thewonkusisback9592 7 месяцев назад

    I’m sort of new to all this, but I followed the exact steps you did in your video and every time I try to run the code it says there’s an error with module import open AI on line 2 how can I fix this?

    • @thomasthemaker
      @thomasthemaker  7 месяцев назад +1

      You will need to install the OpenAI library. Run "pip3 install OpenAI" in your terminal

    • @thewonkusisback9592
      @thewonkusisback9592 7 месяцев назад

      @@thomasthemaker thanks very much for the help

  • @kiiyon5178
    @kiiyon5178 Год назад

    wonderful!
    Is it possible to do this on pico or any other raspberry pi?

    • @thomasthemaker
      @thomasthemaker  Год назад

      Not on the pico ( it's a microcontroller) but on any other single board computers yes

  • @marti4679
    @marti4679 Год назад +1

    THOOOOMAAASSSSSS....... I LOVEEE YOURRR PROGET BUT I WOULD LIKE TO KNOW HOW TO CHANGE THE VOICE OF THE ASSISTANT .

    • @trispytreems
      @trispytreems 3 месяца назад

      I second this, I wanna try out some different AI voices 🙂

  • @epicfortnite9562
    @epicfortnite9562 6 месяцев назад

    Hey this is amazing! but how can I plug my computer monitor keyboard and Mose into the device

    • @epicfortnite9562
      @epicfortnite9562 6 месяцев назад

      mouse

    • @thomasthemaker
      @thomasthemaker  6 месяцев назад

      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