Skip to main content

Next-generation Gemini API Client

A human-friendly API client for the Gemini API, with support for text, image, and video inputs.

Installation

pip install -U gemini-ng

Usage

  1. Set the GEMINI_NG_API_KEY environment variable with your Google AI Studio API key.

  2. Use the client to interact with the Gemini API.

from gemini_ng import GeminiClient

client = GeminiClient() # api key from environment variable `GEMINI_NG_API_KEY`

with client.start_chat(model="models/gemini-1.5-pro-latest") as chat:
    image = client.upload_image("path/to/image.jpg")
    video = client.upload_video("path/to/video.mp4", verbose=True)

    prompt = [
        video,
        image,
        "Describe the scene in the video and the image above in detail.",
    ]
    rsp = chat.send_message(prompt)

    print(rsp.candidates[0].text)

License

This project is licensed under the terms of the MIT license. See the LICENSE file for details.

Release files for gemini-ng 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gemini-ng 0.1.4
File Size Uploaded
gemini_ng-0.1.4.tar.gz 11.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gemini-ng 0.1.4
File Interpreter ABI Platform
gemini_ng-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 24.6 kB

Release files / gemini_ng-0.1.4.tar.gz

Download URL gemini_ng-0.1.4.tar.gz
Size 11.2 kB
Tags Source
SHA-256 checksum
How to use checksums
27cc2c93b6667b1126de29542a9ed2c2b6eabaa90ba5e1a191d5ef1c5c1618eb
BLAKE2b-256 checksum
How to use checksums
a48d45e564576958b26b3a61871c67842cd073c7b7f11e7fa79e03001e21fe2b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.8

Release files / gemini_ng-0.1.4-py3-none-any.whl

Download URL gemini_ng-0.1.4-py3-none-any.whl
Size 13.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
82836ddfe3c4032c0e05f0666f0aee5da494180cf5468210c9917e26ef4dd0ef
BLAKE2b-256 checksum
How to use checksums
fe97df1009106600900cc90f60218459c6c481c00b10ca02bfbc80ee5cc45501
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.8

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page