pub struct LlmResponse {Show 17 fields
pub content: Option<Content>,
pub citation_metadata: Option<CitationMetadata>,
pub grounding_metadata: Option<GroundingMetadata>,
pub usage_metadata: Option<GenerateContentResponseUsageMetadata>,
pub custom_metadata: Map<String, Value>,
pub logprobs_result: Option<LogprobsResult>,
pub input_transcription: Option<Transcription>,
pub output_transcription: Option<Transcription>,
pub model_version: String,
pub partial: bool,
pub turn_complete: bool,
pub interrupted: bool,
pub session_resumption_handle: String,
pub error_code: String,
pub error_message: String,
pub finish_reason: Option<FinishReason>,
pub avg_logprobs: f64,
}Expand description
The raw LLM response. It provides the first candidate response from the model if available.
Fields§
§content: Option<Content>Content of the first candidate.
citation_metadata: Option<CitationMetadata>Citation metadata.
grounding_metadata: Option<GroundingMetadata>Grounding metadata.
usage_metadata: Option<GenerateContentResponseUsageMetadata>Usage metadata.
custom_metadata: Map<String, Value>Arbitrary caller metadata.
logprobs_result: Option<LogprobsResult>Log-probability results.
input_transcription: Option<Transcription>Transcription of audio input (live).
output_transcription: Option<Transcription>Transcription of audio output (live).
model_version: StringModel version that produced the response.
partial: boolWhether the content is part of an unfinished content stream.
turn_complete: boolWhether the response from the model is complete (streaming only).
interrupted: boolWhether the LLM was interrupted while generating.
session_resumption_handle: StringLive session resumption handle.
error_code: StringError code, if any.
error_message: StringError message, if any.
finish_reason: Option<FinishReason>Finish reason of the first candidate.
avg_logprobs: f64Average log probability of the first candidate.
Trait Implementations§
Source§impl Clone for LlmResponse
impl Clone for LlmResponse
Source§impl Debug for LlmResponse
impl Debug for LlmResponse
Source§impl Default for LlmResponse
impl Default for LlmResponse
Source§impl<'de> Deserialize<'de> for LlmResponse
impl<'de> Deserialize<'de> for LlmResponse
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for LlmResponse
impl PartialEq for LlmResponse
Source§impl Serialize for LlmResponse
impl Serialize for LlmResponse
impl StructuralPartialEq for LlmResponse
Auto Trait Implementations§
impl !Freeze for LlmResponse
impl Forget for LlmResponse
impl Move for LlmResponse
impl RefUnwindSafe for LlmResponse
impl Send for LlmResponse
impl Sync for LlmResponse
impl Unpin for LlmResponse
impl UnsafeUnpin for LlmResponse
impl UnwindSafe for LlmResponse
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more