google.ai.generativelanguage.Candidate

A response candidate generated from the model.

index int

Output only. Index of the candidate in the list of candidates.

content google.ai.generativelanguage.Content

Output only. Generated content returned from the model.

finish_reason google.ai.generativelanguage.Candidate.FinishReason

Optional. Output only. The reason why the model stopped generating tokens. If empty, the model has not stopped generating the tokens.

safety_ratings MutableSequence[google.ai.generativelanguage.SafetyRating]

List of ratings for the safety of a response candidate. There is at most one rating per category.

citation_metadata google.ai.generativelanguage.CitationMetadata

Output only. Citation information for model-generated candidate.

This field may be populated with recitation information for any text included in the content. These are passages that are "recited" from copyrighted material in the foundational LLM's training data.

token_count int

Output only. Token count for this candidate.

grounding_attributions MutableSequence[google.ai.generativelanguage.GroundingAttribution]

Output only. Attribution information for sources that contributed to a grounded answer.

This field is populated for GenerateAnswer calls.

Child Classes

class FinishReason