| Crates.io | gemini_light_rs |
| lib.rs | gemini_light_rs |
| version | 0.1.1 |
| created_at | 2025-07-10 15:39:02.271705+00 |
| updated_at | 2025-09-02 21:37:45.012693+00 |
| description | A Rust client for interacting with Google's Gemini API. |
| homepage | |
| repository | https://github.com/Priyansh6747/Gemini_rs |
| max_upload_size | |
| id | 1746659 |
| size | 58,745 |
A Rust client for interacting with Google's Gemini generative language models. Supports conversation memory, stateless calls, and easy integration.
Add to your Cargo.toml:
[dependencies]
gemini_light_rs = "0.1.0"
You need a Google Gemini API key
pass the key and model as arguments to Client::new.
use gemini_light_rs::Client;
#[tokio::main]
async fn main() {
let mut c = Client::new("your_api_key", "gemini-2.5-flash");
let res = c.chat("Hello my name is Max").await;
if let Err(e) = res {
panic!("{}", e);
}
let res2 = c.chat("Whats my name answer in single word only (answer containing more than 1 word will be treated as incorrect)").await;
let name = res2.unwrap_or_else(|_| "Error".to_string());
println!("Gemini answered: {}", name);
assert_eq!(&name, "Max");
}
Client::new(api_key, model) – create a new client
client.chat(input) – send a message, get a response (with memory)
client.chat_once(input) – stateless single message
client.clear_memory() – clear conversation history