Candidate

class Candidate


A Candidate represents a single response generated by the model for a given request.

Summary

Public properties

CitationMetadata?

Metadata about the sources used to generate this content.

Content

The actual content generated by the model.

String?

The optional message associated with the finish reason, providing more details.

FinishReason?

The reason the model stopped generating content, if it exists.

GroundingMetadata?

Metadata returned to the client when the model grounds its response.

List<SafetyRating>

A list of SafetyRatings describing the generated content.

UrlContextMetadata?

Metadata returned to the client when the UrlContext tool is enabled.

Public properties

citationMetadata

val citationMetadata: CitationMetadata?

Metadata about the sources used to generate this content.

content

val content: Content

The actual content generated by the model.

finishMessage

val finishMessage: String?

The optional message associated with the finish reason, providing more details.

finishReason

val finishReason: FinishReason?

The reason the model stopped generating content, if it exists.

groundingMetadata

val groundingMetadata: GroundingMetadata?

Metadata returned to the client when the model grounds its response.

safetyRatings

val safetyRatings: List<SafetyRating>

A list of SafetyRatings describing the generated content.

urlContextMetadata

val urlContextMetadata: UrlContextMetadata?

Metadata returned to the client when the UrlContext tool is enabled.