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
11
12
13
use rust_genai::Client;

#[tokio::main]
async fn main() -> rust_genai::Result<()> {
    let client = Client::from_env()?;
    let Ok(store) = std::env::var("GENAI_FILE_SEARCH_STORE") else {
        eprintln!("请设置 GENAI_FILE_SEARCH_STORE(如 fileSearchStores/xxx)。");
        return Ok(());
    };
    let docs = client.documents().list(store).await?;
    println!("{documents:?}", documents = docs.documents);
    Ok(())
}