pub struct GenerationResponse {
pub candidates: Vec<Candidate>,
pub prompt_feedback: Option<PromptFeedback>,
pub usage_metadata: Option<UsageMetadata>,
pub model_version: Option<String>,
pub response_id: Option<String>,
}Use crate::interactions::Interaction instead. See migration guide: interactions-api/migration-plan.md
Expand description
Response from the Gemini API for content generation
Fields§
§candidates: Vec<Candidate>Use crate::interactions::Interaction instead. See migration guide: interactions-api/migration-plan.md
The candidates generated
prompt_feedback: Option<PromptFeedback>Use crate::interactions::Interaction instead. See migration guide: interactions-api/migration-plan.md
The prompt feedback
usage_metadata: Option<UsageMetadata>Use crate::interactions::Interaction instead. See migration guide: interactions-api/migration-plan.md
Usage metadata
model_version: Option<String>Use crate::interactions::Interaction instead. See migration guide: interactions-api/migration-plan.md
Model version used
response_id: Option<String>Use crate::interactions::Interaction instead. See migration guide: interactions-api/migration-plan.md
Response ID
Implementations§
Source§impl GenerationResponse
impl GenerationResponse
Sourcepub fn function_calls(&self) -> Vec<&FunctionCall>
pub fn function_calls(&self) -> Vec<&FunctionCall>
Get function calls from the response
Sourcepub fn function_calls_with_thoughts(
&self,
) -> Vec<(&FunctionCall, Option<&String>)>
pub fn function_calls_with_thoughts( &self, ) -> Vec<(&FunctionCall, Option<&String>)>
Get function calls with their thought signatures from the response
Trait Implementations§
Source§impl Clone for GenerationResponse
impl Clone for GenerationResponse
Source§fn clone(&self) -> GenerationResponse
fn clone(&self) -> GenerationResponse
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more