pub struct LlmResponse {Show 13 fields
pub content: Option<Content>,
pub grounding_metadata: Option<GroundingMetadata>,
pub partial: Option<bool>,
pub turn_complete: Option<bool>,
pub error_code: Option<String>,
pub error_message: Option<String>,
pub interrupted: Option<bool>,
pub custom_metadata: Option<String>,
pub usage_metadata: Option<Value>,
pub finish_reason: Option<Value>,
pub live_session_resumption_update: Option<SessionResumptionUpdatePayload>,
pub input_transcription: Option<TranscriptionPayload>,
pub output_transcription: Option<TranscriptionPayload>,
}Expand description
LLM response class that provides the first candidate response from the model if available. Otherwise, returns error code and message.
Fields§
§content: Option<Content>The content of the response.
grounding_metadata: Option<GroundingMetadata>The grounding metadata of the response.
partial: Option<bool>Indicates whether the text content is part of a unfinished text stream. Only used for streaming mode and when the content is plain text.
turn_complete: Option<bool>Indicates whether the response from the model is complete. Only used for streaming mode.
error_code: Option<String>Error code if the response is an error. Code varies by model.
error_message: Option<String>Error message if the response is an error.
interrupted: Option<bool>Flag indicating that LLM was interrupted when generating the content. Usually it’s due to user interruption during a bidi streaming.
custom_metadata: Option<String>The custom metadata of the LlmResponse. An optional key-value pair to label an LlmResponse. NOTE: the entire object must be JSON serializable.
usage_metadata: Option<Value>The usage metadata of the LlmResponse.
finish_reason: Option<Value>The finish reason of the response.
live_session_resumption_update: Option<SessionResumptionUpdatePayload>The session resumption update of the LlmResponse
input_transcription: Option<TranscriptionPayload>Audio transcription of user input.
output_transcription: Option<TranscriptionPayload>Audio transcription of model output.
Trait Implementations§
Source§impl Clone for LlmResponse
impl Clone for LlmResponse
Source§fn clone(&self) -> LlmResponse
fn clone(&self) -> LlmResponse
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more