GenerateContentResponse

@Serializable
data class GenerateContentResponse(val sdkHttpResponse: HttpResponse? = null, val candidates: List<Candidate>? = null, val createTime: Instant? = null, val modelVersion: String? = null, val promptFeedback: GenerateContentResponsePromptFeedback? = null, val responseId: String? = null, val usageMetadata: GenerateContentResponseUsageMetadata? = null, val modelStatus: ModelStatus? = null)

Response message for PredictionService.GenerateContent.

Constructors

Link copied to clipboard
constructor(sdkHttpResponse: HttpResponse? = null, candidates: List<Candidate>? = null, createTime: Instant? = null, modelVersion: String? = null, promptFeedback: GenerateContentResponsePromptFeedback? = null, responseId: String? = null, usageMetadata: GenerateContentResponseUsageMetadata? = null, modelStatus: ModelStatus? = null)

Properties

Link copied to clipboard
val candidates: List<Candidate>? = null

Response variations returned by the model.

Link copied to clipboard
@Serializable(with = InstantSerializer::class)
val createTime: Instant? = null

Timestamp when the request is made to the server.

Link copied to clipboard

Returns the list of function calls in the response.

Link copied to clipboard

Output only. The current model status of this model. This field is not supported in Vertex AI.

Link copied to clipboard
val modelVersion: String? = null

Output only. The model version used to generate the response.

Link copied to clipboard

Output only. Content filter results for a prompt sent in the request. Note: Sent only in the first stream chunk. Only happens when no candidates were generated due to content violations.

Link copied to clipboard
val responseId: String? = null

Output only. response_id is used to identify each response. It is the encoding of the event_id.

Link copied to clipboard

Used to retain the full HTTP response.

Link copied to clipboard
val text: String?

Returns the concatenation of all text parts in the response.

Link copied to clipboard

Usage metadata about the response(s).