Candidate

public final classCandidate


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

Summary

Public fields

finalCitationMetadata

Metadata about the sources used to generate this content.

final @NonNullContent

The actual content generated by the model.

finalFinishReason

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

finalGroundingMetadata

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

final @NonNullList<@NonNullSafetyRating>

A list ofSafetyRatings describing the generated content.

finalUrlContextMetadata

Metadata returned to the client when theUrlContext tool is enabled.

Public fields

citationMetadata

public final CitationMetadata citationMetadata

Metadata about the sources used to generate this content.

content

public final @NonNullContent 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 @NonNullList<@NonNullSafetyRatingsafetyRatings

A list ofSafetyRatings describing the generated content.

urlContextMetadata

@PublicPreviewAPI
public final UrlContextMetadata urlContextMetadata

Metadata returned to the client when theUrlContext tool is enabled.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-10-09 UTC.