LlmResponse
data class LlmResponse(val content: Content? = null, val usageMetadata: UsageMetadata? = null, val finishReason: FinishReason? = null, val errorMessage: String? = null, val partial: Boolean = false, val interrupted: Boolean = false, val modelVersion: String? = null, val citationMetadata: CitationMetadata? = null, val groundingMetadata: GroundingMetadata? = null)
LLM response class that provides the first candidate response from the model if available. Otherwise, contains the error code and message.
Constructors
Link copied to clipboard
constructor(content: Content? = null, usageMetadata: UsageMetadata? = null, finishReason: FinishReason? = null, errorMessage: String? = null, partial: Boolean = false, interrupted: Boolean = false, modelVersion: String? = null, citationMetadata: CitationMetadata? = null, groundingMetadata: GroundingMetadata? = null)
Properties
Link copied to clipboard
The citation metadata of the response.
Link copied to clipboard
Error message if the response is an error.
Link copied to clipboard
The finish reason of the response.
Link copied to clipboard
The grounding metadata of the response.
Link copied to clipboard
Flag indicating that LLM was interrupted when generating the content. Usually it's due to user interruption during a bidi streaming.
Link copied to clipboard
The model version used to generate the response.
Link copied to clipboard
The usage metadata of the LlmResponse.