Build a Gemini Voice Assistant in Python
Ғылым және технология
Build Your Own AI Voice Assistant with Python: Gemini + OpenAI TTS + Faster Whisper
In this in-depth tutorial, I'll show you how to create a powerful voice assistant using Python, the Gemini API, OpenAI's Text-to-Speech (TTS) engine, and the supercharged Whisper transcription model.
Key Skills You'll Master:
Gemini Integration: Learn to use Google's Gemini API for smooth, advanced conversation management with your AI.
OpenAI TTS: Give your assistant a realistic voice with OpenAI's high-quality text-to-speech streaming API.
Faster Whisper: Boost speech recognition accuracy and speed with the cutting-edge Whisper transcription model.
Python Coding: Follow my clear code explanations and build your project step-by-step.
Join Ai Austin PRO Discord Channels: www.buymeacoffee.com/aiaustin
Ai Austin Discord Server: / discord
FREE NO CODE GPT VOICE ASSISTANT ONLINE: voigpt.com
#googlegemini #ai #python
Пікірлер: 47
Thanks, I'm working on it tomorrow 😊
Ai Austin you the man! Excellent content! Much respect! 🤜🏾🤛🏼
@Ai_Austin
Ай бұрын
I appreciate that!
This is a great tutorial! I was wondering if you could consider adding a vision component to it in the future will be 🔥
Please show how to install it in Android as it would be more useful in Android, very good video thanks for the insights
I will try this. Thank you
@Ai_Austin
Ай бұрын
Hope you enjoy
yoooooooooo the ending is littttttttttttt
Great tutorial man. I just wonder if running this on the cloud is possible? And what would be your recommendation? Keep up the good work man!
if I could put my two cents on having or not the source code from discord or github. This video as it is, AI Austin is giving us the free source code of this amazing tutorial as always, we just have to be patient and following video and type away those line of codes // codes blocks and you got the full working snippet as always ..... Thanks a lot AI Austin ..... (Note: Copy / Paste really won't help you a lot to learn and understand any snippet explained regardless how good is the author explaining such as it is the case here. If one wants to learn about coding, python language and get 'first hand' experience , one must code , search, READ !!!, PRACTICE!!! , Golden rules ..... try and error, you fall..... you stand up /// Error Crash --- Troubleshoot and fix "you stand up" ...... Cheers!!! Happy coding !!!
@Ai_Austin
Ай бұрын
Well said. I totally agree copying and pasting isn't going to help anyone. Learn. Might be a convenience thing for some to compare to my actual code on there machine. Most people try to skip the video, copy and paste my github code, then complain it doesn't work on the free side of my discord. The real value of the PRO membership is the chat channel escaping that lazy insanity common in most people intrigued by my videos. Glad to hear the algorithm found someone actually interested in developing this skill, as I aim to make this content for. Thanks for the support brotha!
Thanks!
@Ai_Austin
Ай бұрын
thank you for the support!
Thnx but I am getting error module 'google.generativeai' has no attribute 'GenerativeModel' tried it in many versions of python and installed it many times.Please help
@Ai_Austin
2 ай бұрын
Could be the incorrect version of the genai library. I would try uninstalling the library and reinstalling. GenerativeModel is the correct class in the library, as stated by their documentation.
@shishwankalva775
Ай бұрын
Bro have you solved this issue!?
Newbie in coding here🙋♂. Hello from Mexico!! Hi Austin. For days now I have tried to follow tutorials to create my own AI assistant with the little understading I have about python. I was ALMOST succesfull to use Crewai but something always went wrong in the end so I got frustrated and ended up creating one in OPENAI in 2 minutes but i have to pay constantly for tokens.😔. I came across your video and its amazing! Even someone like me can understand it. Thank you!! Now, I have only 2 questions: 1. I didnt undersant in which of the code part should I include a "context" so I can give it a specific personality? 2. How does this code keep "memory" or keep track of the conversations so it keeps "learning" and being costumizable? (Aside from the pre-programmed context i have made assistants "learn" to analyze an attached file so it can understand better how to behave.) Thank you in advance and I wish you all the best!
@Ai_Austin
Ай бұрын
Appreciate feedback. For giving it a personality, you would want to adjust the system message. This program does not have memory of previous conversations. It remembers everything in the conversation until you hit a context limit or restart the program. My next video that will be live in a few days will show you how to use embeddings to create an agent to remember what you choose!
@novadocnews
Ай бұрын
@@Ai_Austin Thankyou!! Just suscribed :)
With the google ai API key 3:49 , How long I can use that API key? and is it completely free or do I need to pay any money? Anybody comment.
@GamerzEmpire125
7 сағат бұрын
Free but limited, only some messages a minute.
This shit is too funny, I had to work my way because I did it in a conda env ( I do not recommand) and at the end not able to wake up Gemini (maybe my french canadian accent) I looked the end of the video to hear the prononciation and the video wake up my Gemini and wrote me a Dank rap song !!!!
@Ai_Austin
Ай бұрын
🤣
Bro why are suggesting paid audios like there are many free and open-source libraries for it like pyaudio
@Ai_Austin
Ай бұрын
1. People want to know how to give their voice assistant a higher quality voice with OpenAI and some people can afford to add $5 of credit every two months to get a better experience from their assistant. 2. No resource exists with the streaming method I showed online 3. PyAudio does not have tts 4. There is no value in showing the same voice assistant code in every video with a different language model. This gives people ability to learn multiple TTS libraries going through my videos so they can find out what works best for them. If that was the route I was going, I'd make one voice assistant tutorial and a bunch of "how to use this new LLM in python" videos. 5. You can never please everyone. If you think you can create programming videos that satisfies 100% peoples preferences, show me your success rate and how you did it. Otherwise, hope you enjoyed MY programming tutorial from MY preferences. 6. No open source library is going to compare in voice quality without taking 5 minutes to generate a sentence of audio. So the simple answer: it was the content creation choice that makes the most sense for my content.
bro why are you not uploading the source code in github? 🙃
@Ai_Austin
2 ай бұрын
It's available on the PRO channels of my Discord for people who care to support the work I put into making the code, so I can continue making the code 🙃
@neoyt8805
2 ай бұрын
@@Ai_Austin bro I'm 15 I can't afford 25$ per month...also I'm Indian tooo..I've been watching your videos since the start
@Ai_Austin
2 ай бұрын
Appreciate that buddy. If you don't have money, then you have time. Learning to code can make you money. Going through the actual video, will help you learn better so you don't need my tutorials. Hope you enjoyed this one!
@neoyt8805
2 ай бұрын
But I've always depended on your source code bro..😢. Anyway bro I got the ask Gemini button after that some errors are coming..😢
@seththunder2077
2 ай бұрын
@@neoyt8805 You need to appreciate the effort he puts in and the time it takes to do these videos. It looks easy with just 1 code after the other but the amount of errors he had to go through definitely hurt his head. Maybe you're just 15 now but one day you will realize how low $25 is for the quality he provides.
How can you not like this style and learning something, you bring it as adventure story, very good use of GenAI, if you do this you can partner with Netflix
I can tell you one thing though, if the result is this hugely annoying angry sibilant voice that the video has I am 100% not interested.
Dude got a nice voice but hes prefere to use ai voices
I hate when ppl ask me for code, nothing is free in this world and certainly not my time
@Ai_Austin
Ай бұрын
respect! ✊
hi, I'm getting this error can you pls tell me how to resolve this AttributeError: module 'google.generativeai' has no attribute 'GenerativeModel'
@shishwankalva775
Ай бұрын
Bro have you solved this error
@Ai_Austin
Ай бұрын
this means you have an old version of google.generativeai installed and need to upgrade it to the newest version that contain the GenerativeModel class.
I get this in output Ask Gemini: What are you? response: GenerateContentResponse( done=True, iterator=None, result=glm.GenerateContentResponse({'candidates': [{'content': {'parts': [{'text': 'I am Gemini, a large multi-modal model, trained by Google. I am designed to understand and generate human language, answer questions, and provide information on a wide range of topics.'}], 'role': 'model'}, 'finish_reason': 1, 'index': 0, 'safety_ratings': [{'category': 9, 'probability': 1, 'blocked': False}, {'category': 8, 'probability': 1, 'blocked': False}, {'category': 7, 'probability': 1, 'blocked': False}, {'category': 10, 'probability': 1, 'blocked': False}], 'token_count': 0, 'grounding_attributions': []}]}), ) When running this code import google.generativeai as genai GOOGLE_API_KEY = 'your_google_api_key' genai.configure(api_key=GOOGLE_API_KEY) model = genai.GenerativeModel('gemini-1.0-pro-latest') response = model.generate_content(input("Ask Gemini: ")) print(response) what should I do to get the output like this. 5:09
@Ai_Austin
28 күн бұрын
print(response.text) to select only the text value in the response
@bosvikanimations728
25 күн бұрын
@@Ai_Austin Thanks bro. And could you make a video or tell me about How can I implement gTTS instead of Openai Key
@adityakak8661
12 күн бұрын
@@Ai_Austin Ask Gemini: hhjjkkl Traceback (most recent call last): File "/main.py", line 43, in print(response.text) ^^^^^^^^^^^^^ File "/opt/anaconda3/lib/python3.11/site-packages/google/generativeai/types/generation_types.py", line 407, in text if len(parts) != 1 or "text" not in parts[0]: ^^^^^^^^^^^^^^^^^^^^^^ TypeError: argument of type 'Part' is not iterable i am getting this in the terminal (the ask gemini line is where i put in the text input)
@adityakak8661
11 күн бұрын
@@Ai_Austin Ask Gemini: who are you Traceback (most recent call last): File "/main.py", line 42, in print(response.text) ^^^^^^^^^^^^^ File "/opt/anaconda3/lib/python3.11/site-packages/google/generativeai/types/generation_types.py", line 407, in text if len(parts) != 1 or "text" not in parts[0]: ^^^^^^^^^^^^^^^^^^^^^^ TypeError: argument of type 'Part' is not iterable this is the error im getting, when doing print(response.text). how do i fix this?