Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

Google Cloud Platform logo

Simple application to interact with Gemini API

"Python: Gemini API" is a simple sample application that shows you how to interact with Google's Gemini APIs .

Table of Contents

Directory contents

  • launch.json - config file for later when you deploy your application to Google Cloud
  • main.py - the Python sample application that asks Gemini API to generate content based on a prompt
  • requirements.txt - includes the google generative ai dependency

Setting up the API Key

Before you can use the Gemini API, you must first obtain an API key. If you don't already have one, create a key with one click in Google AI Studio. Get API

Getting started with Cloud Code

Run the application locally

  1. Make sure you have generated the API key as shown above. Please make sure to use and store this key securely.

  2. Install the package using pip install -r requirements.txt

  3. Run this using python main.py

Documentation

  1. You can see detailed API Reference for the Gemini APIs here

  2. You can see more samples and things to do here

Other things to try

  1. If you're new to Google Cloud, create an account to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.

  2. Install the Cloud Code VS Code plugin or Jetbrains Extension if you haven't already.

  3. Access Cloud Code documentation to learn how you can deploy your app to Google Cloud

Sign up for user research

We want to hear your feedback!

The Cloud Code team is inviting our user community to sign-up to participate in Google User Experience Research.

If you’re invited to join a study, you may try out a new product or tell us what you think about the products you use every day. At this time, Google is only sending invitations for upcoming remote studies. Once a study is complete, you’ll receive a token of thanks for your participation such as a gift card or some Google swag.

Sign up using this link and answer a few questions about yourself, as this will help our research team match you to studies that are a great fit.