rust-genai 0.3.1

Rust SDK for the Google Gemini API and Vertex AI
Documentation
1
2
3
4
5
6
7
8
9
10
use rust_genai::Client;

#[tokio::main]
async fn main() -> rust_genai::Result<()> {
    let client = Client::from_env()?;
    let chat = client.chats().create("gemini-2.5-flash-lite");
    let response = chat.send_message("你好").await?;
    println!("{:?}", response.text());
    Ok(())
}