Package com.google.genai.types
Class Candidate
java.lang.Object
com.google.genai.JsonSerializable
com.google.genai.types.Candidate
A response candidate generated from the model.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionOutput only.static Candidate.Builder
builder()
Instantiates a builder for Candidate.abstract Optional<CitationMetadata>
Source attribution of the generated content.content()
Contains the multi-part content of the response.Describes the reason the model stopped generating tokens.abstract Optional<FinishReason>
The reason why the model stopped generating tokens.static Candidate
Deserializes a JSON string to a Candidate object.abstract Optional<GroundingMetadata>
Output only.index()
Output only.abstract Optional<LogprobsResult>
Output only.abstract Optional<List<SafetyRating>>
Output only.abstract Candidate.Builder
Creates a builder with the same values as this instance.Number of tokens for this candidate.abstract Optional<UrlContextMetadata>
Metadata related to url context retrieval tool.Methods inherited from class com.google.genai.JsonSerializable
stringToJsonNode, toJson
-
Constructor Details
-
Candidate
public Candidate()
-
-
Method Details
-
content
Contains the multi-part content of the response. -
citationMetadata
Source attribution of the generated content. -
finishMessage
Describes the reason the model stopped generating tokens. -
tokenCount
Number of tokens for this candidate. -
finishReason
The reason why the model stopped generating tokens. If empty, the model has not stopped generating the tokens. -
urlContextMetadata
Metadata related to url context retrieval tool. -
avgLogprobs
Output only. Average log probability score of the candidate. -
groundingMetadata
Output only. Metadata specifies sources used to ground generated content. -
index
Output only. Index of the candidate. -
logprobsResult
Output only. Log-likelihood scores for the response tokens and top tokens -
safetyRatings
Output only. List of ratings for the safety of a response candidate. There is at most one rating per category. -
builder
Instantiates a builder for Candidate. -
toBuilder
Creates a builder with the same values as this instance. -
fromJson
Deserializes a JSON string to a Candidate object.
-