use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize)]
pub struct RequestBody {
#[serde(rename = "contents")]
pub contents: Vec<Content>,
#[serde(rename = "safetySettings")]
pub safety_settings: Option<Vec<SafetySetting>>,
#[serde(rename = "generationConfig")]
pub generation_config: Option<GenerationConfig>,
}
#[derive(Serialize, Deserialize)]
pub struct Content {
#[serde(rename = "parts")]
pub parts: Vec<Part>,
#[serde(rename = "role")]
pub role: Option<String>,
}
#[derive(Serialize, Deserialize)]
pub struct Part {
#[serde(rename = "text")]
pub text: String,
}
#[derive(Serialize, Deserialize)]
pub struct SafetySetting {
#[serde(rename = "category")]
pub category: String,
#[serde(rename = "threshold")]
pub threshold: String,
}
#[derive(Serialize, Deserialize)]
pub struct GenerationConfig {
#[serde(rename = "stopSequences")]
stop_sequences: Vec<String>,
#[serde(rename = "temperature")]
temperature: f32,
#[serde(rename = "maxOutputTokens")]
max_output_tokens: u32,
#[serde(rename = "topP")]
top_p: f32,
#[serde(rename = "topK")]
top_k: u32,
}