Python with Gemini (Gen AI) using Google Colab
Introduction
Models
Input
Follow This 5 Simple Steps To Get Started With Gemini Pro
In this article, we’ll be dealing with Gemini Pro that services text and chat by taking text as an input. So let’s get started with these 5 simple steps .
Step 1 – Obtain an API key to use Gemini API:
APIs are necessary for smooth data sharing among the applications involved. But before that, we need to get an API key. So, visit the Google AI Studio, create an API key and just copy it. For security purpose, the key has to be kept secret and should not be shared publicly.
Step 2 – Save the API key:
Open Google Colab and click on the Secrets tab.
Paste the copied API key under the Value tab and assign a name under the Name tab. Here, we have named it as ‘Google_Studio’.
This is how we will interact with the API using Google Colab.
Step 3 – In order to use Gemini, install the required libraries and setup the model:
Step 4 –Check the list of models from Google AI Studio: