Next-generation Gemini API Client
Project description
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
-
Set the
GEMINI_NG_API_KEY
environment variable with your Google AI Studio API key. -
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.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
gemini_ng-0.1.0.tar.gz
(10.6 kB
view hashes)
Built Distribution
gemini_ng-0.1.0-py3-none-any.whl
(12.6 kB
view hashes)
Close
Hashes for gemini_ng-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2ad47312e1bfb089b791a913923a23b38460cb6c7da14f191c119c29a273b346 |
|
MD5 | 037d5e696db8d6f1b08b24d06944f676 |
|
BLAKE2b-256 | 598d79ad5c8d98d41cb8c543a46b7de8756fda6c98b0e3ad315bc4b03931d412 |