Easily Access Gemini AI API Using Bard, Gemini, & Python - Google Gemini API Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
welcome back to another video as always my name's Jasper and what we're going to be covering today is how to use the Gemini API 2day and that means right now um using an unofficial method uh we will be using The Bard uh python and a python uh Library package as well um to make this all happen it's very easy uh simply from people that don't know how to code and will only take um a few minutes to set up so let's dive in so the first thing you're going to need is a b account um obviously uh definitely one that's using the new Gemini Pro you'll be able to see that by typing in what is uh what what model is being used and then it will tell you if it's used in Gemini Pro or not okay and then the next thing you're going to need uh to know is this uh you're going to need to get this package it's called bar- API um it can be found on GitHub or you can install within your pip Library by just going pip install B API um all these links will be in the description so everything mentioned you can find there uh nice and easy um so then install that and then once you've got that we move on to the actual code aspect a very simple 10 lines so what we have here is from B API and then import cookies and the cookies we're going to need is secure 1 PSID secure 1 PSID DTS and secure 1 PSID CC and that will be the cookies to communicate and connect to B as we don't officially have an API um and then after that we're going to ask it what model are you using and that's going to tell us whether it's using the uh latest Gemini Pro API um or the standard one I've got my one here that has my um the cookie keys in there already so I didn't want to show everybody that uh just in case you know somebody tries accessing my account okay so how do we get these cookies so come across into B right click go to inspect and then go up here go to application then come into cookies you'll see here and then click B and you will find the secure PSID uh that's number one you'll have the secure PSID um DTS and DCC now if you the it is different depending on your account and location I'm not too sure on the rules um if you only have a secure one PSID do not worry you will see here that you can use just the one cookie some locations only have one as you can see here where then you got accounts like mine where they have uh three types so if you've got three use my code if you've only got one get the code off here on the um uh the repo for that um library that python Library as said all the links in the description um okay so once we got that we can move on to actually the code aspect so as you saw before let me just bring that back up you saw this and that is so we'll put all in the cookies here and then you'll save it that's all you need to do so you'll see um I have my one saved here called Gemini um in the B file here and now let's bring our terminal across so the terminal is within this folder and we're going to go Python 3 and then we're going to run the script so Gemini py and it's going to ask that question loading is a good sign still going there we go so we're going to say as of today December 8 20 2023 I'm running on gini I Pro language model this is a large language model developed by Google AI so there you go so as you can see it's already using the Gemini Pro AI um you we doing this by connecting python through to The Bard um actual a I'm sorry The Bard application which is connected to Gemini Pro so you'll be able to easily connect this up to any of your applications anything you want to use um and yeah as you can see it only took a couple of minutes which is amazing um I hope this helped if one out and you learned a bit about python B and apis and yeah um look to seeing you in the next video don't forget to like And subscribe
Info
Channel: Jasper.Studio
Views: 8,831
Rating: undefined out of 5
Keywords: Gemini AI, Gemini, Google Gemini, Google Gemini AI, Gemini API, Gemini AI API, how to access gemini api, how to use gemini api, how to access gemini ai api, how to use gemini ai api, ai tutorial, gemini ai tutorial, google gemini tutorial, bard tutorial, bard ai tutorial, bard ai access tutorial, bard gemini tutorial
Id: 1a6-QrmYf1M
Channel Id: undefined
Length: 4min 3sec (243 seconds)
Published: Sat Dec 09 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.