A unofficial simple Rust wrapper around Google's Gemini API.
Provides statically typed request and response objects as well as an easy to use client.
This is a work-in-progress as we become more familiar with the Google Gemini API, so expect major changes between minor versions. At 0.5.0 we will have stable APIs.
API Key
You may use a .env file for loading your Gemini API key and model using:
GEMINI_API_KEY="MY_KEY_VALUE"
GEMINI_MODEL="gemini-2.0-flash"
but this is not enforced. It's up to the end-user to load their keys.
Example Usage
dotenv?;
let key = var?;
let model = var?;
let mut client = new.with_defaults.await;
let response = client
.send_text
.await?;
println!;
let pic = BASE64_URL_SAFE.encode;
let response = client.send_image_bytes.await?;
println!;
println!;
let response = client
.send_text
.await?;
println!;
Commercial Support
Commercial support may be obtained through Tilton Technologies, LLC at https://tiltontechnologies.com.