"Python: Gemini API" is a simple sample application that shows you how to interact with Google's Gemini APIs .
launch.json- config file for later when you deploy your application to Google Cloudmain.py- the Python sample application that asks Gemini API to generate content based on a promptrequirements.txt- includes the google generative ai dependency
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
-
Make sure you have generated the API key as shown above. Please make sure to use and store this key securely.
-
Install the package using
pip install -r requirements.txt -
Run this using
python main.py
-
You can see detailed API Reference for the Gemini APIs here
-
You can see more samples and things to do here
-
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.
-
Install the Cloud Code VS Code plugin or Jetbrains Extension if you haven't already.
-
Access Cloud Code documentation to learn how you can deploy your app to Google Cloud
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.