Candidate

public final class Candidate


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

Summary

Public fields

final CitationMetadata

Metadata about the sources used to generate this content.

final @NonNull Content

The actual content generated by the model.

final FinishReason

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

final GroundingMetadata

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

final @NonNull List<@NonNull SafetyRating>

A list of SafetyRatings describing the generated content.

final UrlContextMetadata

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

Public fields

citationMetadata

public final CitationMetadata citationMetadata

Metadata about the sources used to generate this content.

content

public final @NonNull Content content

The actual content generated by the model.

finishReason

public final FinishReason finishReason

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

groundingMetadata

public final GroundingMetadata groundingMetadata

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

safetyRatings

public final @NonNull List<@NonNull SafetyRatingsafetyRatings

A list of SafetyRatings describing the generated content.

urlContextMetadata

@PublicPreviewAPI
public final UrlContextMetadata urlContextMetadata

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