Coder Social home page Coder Social logo

bisnuray / gemini-pro Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 2.0 10 KB

Gemini is an advanced artificial intelligence (AI) system designed to intelligently respond to diverse prompts, including pictures, text, speech, music, and code.

Python 100.00%
ai gemini gemini-ai gemini-api gemini-pro

gemini-pro's Introduction

Gemini Pro Python Script ๐ŸŒŒ

Gemini is an advanced artificial intelligence (AI) system designed to intelligently respond to diverse prompts, including pictures, text, speech, music, and code.

Getting Started ๐Ÿš€

To utilize Gemini Pro, configure your environment with the necessary API key and service account credentials. Follow these steps to get started:

Prerequisites

  • Python 3.9 or higher ๐Ÿ
  • Libraries: google-generativeai ๐Ÿ“š
  • Environment Variables: GOOGLE_API_KEY and GOOGLE_APPLICATION_CREDENTIALS ๐Ÿ—๏ธ
  1. Install the required dependencies, ensuring Python 3.9 or higher:

    pip install google-generativeai
  2. Set the Google API key as an environment variable:

    set GOOGLE_API_KEY=<your-api-key>

    Replace <your-api-key> with your actual Google API key.

  3. Set the path to the service account credentials as an environment variable:

    set GOOGLE_APPLICATION_CREDENTIALS=/path/to/serviceaccount.json

    Replace /path/to/serviceaccount.json with the actual path to your service account JSON file.

  4. Create a Google Cloud Platform (GCP) service account and download the JSON key file. Follow these steps:

    • Go to Google Cloud Console.
    • Navigate to the project where you want to create a service account.
    • In the left sidebar, click on the hamburger menu and select "IAM & Admin" > "Service accounts."
    • Click on "Create Service Account" at the top of the page.
    • Enter a name for the service account, choose a role (e.g., Project > Editor), and click "Continue."
    • Skip the "Grant users access to this service account" section and click "Done."
    • Locate the newly created service account in the list and click on the pencil icon to the right.
    • Navigate to the "Add Key" tab, choose JSON as the key type, and click "Create." Save the downloaded JSON file to a secure location.
  5. Obtain a Google API key by following the link here.

Usage ๐Ÿ› ๏ธ

Explore the capabilities of Gemini Pro by running the provided script. It demonstrates how to configure the API key, list available models, and generate content based on text input.

python gemini.py

Author ๐Ÿ“

Feel free to reach out if you have any questions or feedback.

gemini-pro's People

Contributors

bisnuray avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.