pub struct LlmResponse {
pub content: Option<Content>,
pub usage_metadata: Option<UsageMetadata>,
pub finish_reason: Option<FinishReason>,
pub citation_metadata: Option<CitationMetadata>,
pub partial: bool,
pub turn_complete: bool,
pub interrupted: bool,
pub error_code: Option<String>,
pub error_message: Option<String>,
pub provider_metadata: Option<Value>,
pub interaction_id: Option<String>,
}Expand description
Core traits and types.
Always available regardless of feature flags. Includes:
Fields§
§content: Option<Content>The generated content (text, function calls, etc.).
usage_metadata: Option<UsageMetadata>Token usage statistics.
finish_reason: Option<FinishReason>Reason the model stopped generating.
citation_metadata: Option<CitationMetadata>Citation sources referenced in the response.
partial: boolWhether this is a partial streaming chunk.
turn_complete: boolWhether the model has finished its turn.
interrupted: boolWhether the response was interrupted.
error_code: Option<String>Error code from the provider, if any.
error_message: Option<String>Error message from the provider, if any.
provider_metadata: Option<Value>Provider-specific metadata (e.g., response IDs, routing info).
interaction_id: Option<String>Interactions API: the server-assigned interaction id for this turn, used
to continue the conversation via previous_interaction_id. None for
the generateContent transport and non-Gemini providers.
Implementations§
Source§impl LlmResponse
impl LlmResponse
Sourcepub fn new(content: Content) -> LlmResponse
pub fn new(content: Content) -> LlmResponse
Creates a complete (non-streaming) response with the given content.
Trait Implementations§
Source§impl Clone for LlmResponse
impl Clone for LlmResponse
Source§fn clone(&self) -> LlmResponse
fn clone(&self) -> LlmResponse
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more