Expand description
generateContent and streamGenerateContent REST API.
This module provides typed request/response types and a client for the
Gemini generateContent REST API. Feature-gated behind generate.
§Usage
use gemini_genai_rs::{Client, prelude::ModelId};
let client = Client::from_api_key("your-key").model(ModelId::FLASH_LATEST);
let response = client.generate_content("What is Rust?").await?;
println!("{}", response.text().unwrap_or_default());Structs§
- Candidate
- A single response candidate.
- Generate
Content Config - Configuration for a generateContent request.
- Generate
Content Response - Top-level response from generateContent.
- Prompt
Feedback - Feedback about the prompt.
Enums§
- Block
Reason - Reason a prompt was blocked.
- Generate
Error - Errors specific to the Generate API.