Getting Started with Google Gemini Pro API in Google AI Studio & CoLab

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone welcome back to skill Cod today we are taking a deep dive into the Gemini Pro API Google's latest and most powerful language model Google just opened your access to Gemini Pros API okay and the best part is that you can test it like absolutely free no cost at all to use it what you need to do you just simply need to click on like this get API key in Google AI Studio okay if I just click on this thing it will take to like makers suit. google.com Okay so here what you can do you can simply first accept all the terms of service and click on continue okay then you're all good to go okay you can see right over here that I am inside of my Google AI Studio this is how the interface looks like pretty much I can say similar to what it provides in like colab actually okay so Google Gemini Pro is currently only available inside of Google as2 Studio okay so in this you can test out your models you can see right over here on the right hand side here actually in the model section you can see two models Gemini Pro and vision if you choose Gemini Pro Vision so now you can actually you can see upload the image and then if you just simply choose the pro one it's for the textual prom you can maneuver the temperature here as well okay then you can add like stop sequence and under safety settings I am really impressed by this uh as a developer you can control these things like harassment there are three options if you want to block all you can choose this one if you want to block some you can choose this one if you want to like block few one or none you can choose this one okay when you like maneuver these settings so in your application you can use like as you want okay so that's really a cool and great feature that like Google is providing and under the Advan setting you can choose the output length and top K as well and top p as well okay so these these are some settings which are there in the Gemini model so let me just try to give it a test input I'll say like explain generative AI to a fiveth grade student okay let's run it to see how it performs in this scenario all right the generation is pretty quick I'm literally impressed Google's Gemini model is like really good at Imagining the things so I believe that it has done a pretty decent job here as well it says like generative AI is like a magic helper that can create new things from nothing like pictures stories and even music it's super cool and fun to use like it's showing here how it works generative AI can do all sort of amazing things like characteristic images okay design new medicines that's great so yeah that looks really promising if I just switch the model so you can actually choose image here okay let's press tab okay so this is the image uh it says like describe what the people are doing in this image let's send it to see what it generates okay all right it says like two men are playing Cricket the man in foreground is the batsman and the Man in the background is the wicked keeper the batsman is about to hit the ball with his Bat that's really cool the Wicket keeper is standing behind the stumps ready to catch the ball if batsman misses it that's pretty cool and amazing actually okay so all right you can see here that it's actually looking really good so if you're satisfied with the settings of your model like in safety settings as well and advanced setting everything that you need to do with this okay what you need to do you just simply need to click on this like get code and it will actually provide you with the code you have like multiple options you can get code in code JavaScript python okay Android cine and Swift okay if I choose python you can see right over here that it gives you all the code okay gives you necessary like uh installations and everything so here your API key will like go all right so now let's see how to run both models in like Google collab okay so now to run this onto your collab or on anything you need to get the API key just click on this API key and make sure that you save changes which you made like onto your the system click on okay I already create one which I was testing previously but you can create a new one from here okay so this is my new API key I'll simply copy this one close this thing out here okay so now what I need to do I just simply need to come to my Google collab you need to set a your API key you need to go to this thing like secrets and this you need to add your secret key here okay I'll name it as like Gemini uncore key and the value will come here okay yeah now I will simply switch it on okay make sure that your notebook has access to this key so that you can use it inside of your notebook so now I'll simply close this thing out all right so here is the Google callab version of this thing you can see right over here okay so in this video I will show you how to run like uh Gemini Pro and Gemini Pro Vision model so first let's see how to run Gemini Pro text model okay first of all you need to connect your runtime environment okay all right it's connected you can see right over here now what you need to do you just simply need to run these cells okay first of all you're installing like Google generative AI okay and then you need to actually import all the necessary packages you need to set up your API key my API key is named as Gemini key okay I'll simply run this cell and it has configured my API key for me now what I need to do I will just list models which are available okay currently like there are two models available Gemini Pro and Gemini Pro Vision okay now I will be going to actually generate text from like text inputs which is the capability of like Gemini Pro I will simply run this cell and model is actually selected as Gemini Pro so now let me just give it a text and take the response back for that we will be using like model. generatore content okay so I'll just run this cell okay so yeah then response. text okay the meaning of life is a profound question that has occupied the minds of philosopher theologians and other great thinkers throughout history okay you can read more about it from here it's looking actually really nice okay then in simple cases the response. text accessor is all you need okay so you can see right over here what other options you have what you need to do you need two underscore markdown function to actually get a formatted version of this thing you can see right over this is is really a cool thing I love this in this way okay now it says like if the API fail to return a result you can use generate content response. promp feedback to see if it was blocked due to safety concerns or not okay so far I believe that this coab is so well structured it has like everything if you want to learn anything about this this could be the best way like this collab is absolutely smooth as butter okay so if I run response. prom feedback okay so harm category sexually explicit content is negligible and everything is negligible if it is blocked by something so it would indicate here okay now this is a cool thing okay Gemini can generate multiple possible responses for a single prom these responses are called candidates and you can review them to select most suitable one as the response this is the thing which open AI is missing okay if we just simp simply navigate to like B.G google.com Okay so if I just try to click on anything like Veil facts so Bard itself has this like uh behavior when you click on view other drafts so it has like three drafts and it is giving exactly same thing in its API as well okay all right to view the responses you can do like by doing response. candidates okay and it will provide you with like other details as well okay all right then it has like chat conversations as well you can see like Gemini enables you to have free form conversation across multiple turn Okay the chat session class simplifies the process by managing the state of the conversations so unlike the generate content you do have to store the conversation history as a list so this is really important so if I just try to run this cell okay so now I'm going to give it a response like response equals chat do send message okay like we are initiating chat conversation I'm saying in one sentence explain how a computer works to a young child so if I simply run this thing so you see that it's just provided me with like the text okay if I go back to the chat history this was the role of the user and this was the role of the model so it breaks down it into like a lot easier way the purpose of this method like chat conversations is actually the way you communicate with like this thing Bard okay or like some other open AI chat gbt 4 like it can coordinate with the previous responses as well okay all right so now what I'm trying to do I'm trying to see whether this thing takes in regard the previous response as well or not so you can see right over here that I first provided with a prompt like H in one sentence explain how Computer Works to a young child okay then I just said like okay how about a more detailed explanation to a high school I didn't specify anything about like computer or anything to indicate that it is actually connected to the previous response but it works actually like a charm okay you can see right over here that's really a cool and amazing feature okay now you can see the entire history here as well like first user said this model applied in this way then user said this and then model replied in this way so yeah that's really a cool and amazing feature feure okay so that marks the end of our this section like Gemini Pro one okay all right so now let's see how you can use Gemini Pro Vision model that accepts both text and images and inputs it uses like generative model. generate content and this API is designed to handle multimodel prompts and returns a text output okay first of all just I will load the image okay this is my image you can upload from the drive as well it's totally up to you okay now now if you want to open the image you can do that as well like I am using pillow that's totally fine and don't worry I will provide both of these notebooks in the description of this video so that you don't have to go anywhere okay now I have to load like Gemini Pro Vision model you can see right over here it's loaded you have to use like generate content function here okay and provide in with the image if you just provide the image it will actually tell you like what this image is actually about so you see that if I just provided it with the image it just gave me the complete recipe like how to create this cool dish okay you can see right over here there are like ingredients then it has instructions and then it said enjoy okay I am literally impressed with this response but there's another way okay you can use the same function with a prompt as well like write a short engaging blog post for instance this could be really handy use case if your blogger and write blogs regularly okay for this you need to just specify the prompt comma image inside of like this square brackets and then you need to resolve the response okay all right it's done now with the help of like two underscore marked on function what you can do you can just simply uh convert this thing into text okay to see what it is actually okay so you can see right over here it's a cool tiny little blog that it just provided so yeah that's really cool and I am literally impressed by this Google's Gemini Pro API and I believe that it's quite a lot easier to implement and better than open AIS one okay and for the time being it's free so you can benefit from it and make cool applications to showcase on your portfolio Okay one more cool thing that Google has come up with suppose if there is any error in the code if I run this and I get into some error okay like this thing okay if you click on like this explain error now collab a I is here to resolve your errors just click on this thing you can see right over here that collab AI is working on this to resolve the error so it can actually help you to resolve the errors so that's really a cool and amazing and handy feature that Google has come up with okay it's actually free for now but it would be available for like collab Pro users in future okay so yeah that's another cool feature that Google has come up with mind blown by Google's Gemini Pro API same here this AI playground just changed the game now you can go and build something unreal Google whispered the secrets of AI now with the Gemini Pro API the future is in your hand and in your code tell me in the comments what you will create with this cool API feature by Google my brain just did a backflip thanks to Google's Gemini Pro API turns out building the future is actually fun Google's Gemini Pro API is actually a game changer in a set so that marks the end of all this video I hope you like this one thank you so much for watching and I shall catch you up in some other one till then have a good day
Info
Channel: SkillCurb
Views: 2,194
Rating: undefined out of 5
Keywords: how to use gemini ai, how to use gemini google, what is gemini ai, gemini ai, gemini google, gemini, google gemini, gemini tutorial, gemini ai tutorial, how to get started with gemini ai, gemini ai tutorial for beginners, gemini ai crash course, google ai gemini, google ai, how to use google gemini ai, how to use gemini, gemini ai google, google bard, Getting Started with Gemini Pro on Google AI Studio, Gemini pro for text, Gemini Pro Vision, gemini pro api
Id: Xrl3-IF1duQ
Channel Id: undefined
Length: 14min 14sec (854 seconds)
Published: Sun Dec 24 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.