Candidate Class

A response candidate generated from the model.

Definition

Namespace: GenerativeAI.Types
Assembly: GenerativeAI (in GenerativeAI.dll) Version: 2.0.2+aa51399cad6d90cc71158d589a6268608b3c1893
C#
public class Candidate
Inheritance
Object    Candidate

Constructors

CandidateInitializes a new instance of the Candidate class

Properties

AvgLogprobs Output only. Average log probability score of the candidate.
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.
Content Output only. Generated content returned from the model.
FinishReason Optional. Output only. The reason why the model stopped generating tokens. If empty, the model has not stopped generating tokens.
GroundingAttributions Output only. Attribution information for sources that contributed to a grounded answer. This field is populated for GenerateAnswer calls.
GroundingMetadata Output only. Grounding metadata for the candidate. This field is populated for GenerateContent calls.
Index Output only. Index of the candidate in the list of response candidates.
LogprobsResult Output only. Log-likelihood scores for the response tokens and top tokens
SafetyRatings List of ratings for the safety of a response candidate. There is at most one rating per category.
TokenCount Output only. Token count for this candidate.

Methods

EqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
FinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
GetHashCodeServes as the default hash function.
(Inherited from Object)
GetTypeGets the Type of the current instance.
(Inherited from Object)
MemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
ToStringReturns a string that represents the current object.
(Inherited from Object)

See Also