gemini_crate 0.1.0

A robust Rust client library for Google's Gemini AI API with built-in error handling, retry logic, and comprehensive model support
Documentation
use crate::client::GeminiClient;

/// This test sends a real request to the Gemini API using the current stable model.
/// It requires a valid `GEMINI_API_KEY` in a `.env` file in the root of the project.
/// This test is ignored by default because it is slow and requires an API key.
///
/// Note: Updated to use `gemini-2.5-flash` as the `gemini-pro` model has been deprecated.
/// Run it with `cargo test -- --ignored`.
#[tokio::test]
#[ignore]
async fn test_generate_text_real_request() {
    let client = match GeminiClient::new() {
        Ok(c) => c,
        Err(_) => {
            println!("Skipping real request test: GEMINI_API_KEY not found.");
            return;
        }
    };

    let result = client
        .generate_text("gemini-2.5-flash", "What is the capital of France?")
        .await;

    if let Err(e) = &result {
        eprintln!("The real request test failed with an error: {:?}", e);
    }

    assert!(result.is_ok());
    let text = result.unwrap();
    assert!(!text.is_empty());
    println!("Gemini response: {}", text);
}