Class GeminiCandidate
Google Gemini version of ChatChoice.
A response candidate generated from the model.
2025-09-24: Updated new properties to match the latest Gemini API.
Inherited Members
Namespace: Glitch9.AIDevKit.Google
Assembly: Glitch9.AIDevKit.Provider.Google.dll
Syntax
public sealed class GeminiCandidate
Properties
| Edit this page View SourceAvgLogprobs
Output only. Average log probability score of the candidate.
Declaration
[JsonProperty("avgLogprobs")]
public float? AvgLogprobs { get; set; }
Property Value
| Type | Description |
|---|---|
| float? |
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.
Declaration
[JsonProperty("citationMetadata")]
public CitationMetadata CitationMetadata { get; set; }
Property Value
| Type | Description |
|---|---|
| CitationMetadata |
Content
Output only. Generated content returned from the model.
Declaration
[JsonProperty("content")]
public GeminiContent Content { get; set; }
Property Value
| Type | Description |
|---|---|
| GeminiContent |
FinishReason
Optional. Output only.
The reason why the model stopped generating tokens.
If empty, the model has not stopped generating the tokens.
The official Gemini API's class name is "FinishReason",
but we use our common enum FinishReason here.
Declaration
[JsonProperty("finishReason")]
public FinishReason? FinishReason { get; set; }
Property Value
| Type | Description |
|---|---|
| FinishReason? |
GroundingAttributions
Output only. Token count for this candidate. This field is populated for GenerateAnswer calls.
Declaration
[JsonProperty("groundingAttributions")]
public GroundingAttribution[] GroundingAttributions { get; set; }
Property Value
| Type | Description |
|---|---|
| GroundingAttribution[] |
GroundingMetadata
Output only. When a response is successfully grounded, the response includes a groundingMetadata field. This structured data is essential for verifying claims and building a rich citation experience in your application.
Declaration
[JsonProperty("groundingMetadata")]
public GroundingMetadata GroundingMetadata { get; set; }
Property Value
| Type | Description |
|---|---|
| GroundingMetadata |
Index
Output only. Index of the candidate in the list of candidates.
Declaration
[JsonProperty("index")]
public int? Index { get; set; }
Property Value
| Type | Description |
|---|---|
| int? |
LogprobsResult
Output only. Log-likelihood scores for the response tokens and top tokens
Declaration
[JsonProperty("logprobsResult")]
public LogprobsResult LogprobsResult { get; set; }
Property Value
| Type | Description |
|---|---|
| LogprobsResult |
SafetyRatings
List of ratings for the safety of a response candidate. There is at most one rating per category.
Declaration
[JsonProperty("safetyRatings")]
public SafetyRating[] SafetyRatings { get; set; }
Property Value
| Type | Description |
|---|---|
| SafetyRating[] |
TokenCount
Output only. Token count for this candidate.
Declaration
[JsonProperty("tokenCount")]
public int TokenCount { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
UrlContextMetadata
Output only. Metadata related to url context retrieval tool.
Declaration
[JsonProperty("urlContextMetadata")]
public UrlContextMetadata UrlContextMetadata { get; set; }
Property Value
| Type | Description |
|---|---|
| UrlContextMetadata |