gemini-rs

Crates.iogemini-rs
lib.rsgemini-rs
version0.4.2
sourcesrc
created_at2024-10-30 20:57:06.119097
updated_at2024-11-15 03:32:22.922047
descriptionA library to interact with the Google Gemini API
homepagehttps://github.com/Shuflduf/gemini-rs
repositoryhttps://github.com/Shuflduf/gemini-rs
max_upload_size
id1429190
size60,384
Shuflduf (Shuflduf)

documentation

README

STILL A WIP

A library to use Google Gemini's API directly in Rust! Made because the current options weren't very capable and didn't support 100% of the official API.

Example

// main.rs
use gemini_rs::Conversation;

#[tokio::main]
async fn main() {
    let mut convo = Conversation::new(
        std::env::var("GEMINI_API_KEY").unwrap(), // Replace with however you want to get your API key
        "gemini-1.5-flash".to_string() // Replace with the desired model from https://ai.google.dev/gemini-api/docs/models/gemini
    );

    let a = convo.prompt("If you had to describe Risk of Rain 2 in one word, what word would it be?").await;
    println!("{a}");
    let b = convo.prompt("Now explain your reasoning").await;
    println!("{b}");
}

Roadmap

  • Error handling
  • Conversation history
  • Useless refactor for no good reason (cry for help) (x2)
  • Make more operations for conversations (saving, loading, etc.)
  • Image support
  • Better documentation
  • 100% API coverage
Commit count: 61

cargo fmt