Introduction

Hi folks! Welcome to an another exciting blog at Gamaka AI. This article basically deals with the use of Python with Gen AI using Google Colab. The advantage of using Google Colab is that it allows you to write and execute Python code directly in your browser without any setup or installation. It is a cloud-based Jupyter Notebook environment provided by Google. Here, we will be considering Gemini – a family of Gen AI created by Google DeepMind known for its multimodality and seamless reasonability across text, code, audio and images. A dynamic, general purpose programming language such as Python can then be leveraged with Gen AI which has a huge potential to generate excellent results.

Models​

Input

– Gemini 1.5 Pro (Preview only)
– Gemini 1.0 Pro
– Gemini 1.0 Pro Vision
Text and Images
Test
Text and Images

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: