Search Results for

    Show / Hide Table of Contents

    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.

    Inheritance
    object
    GeminiCandidate
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Glitch9.AIDevKit.Google
    Assembly: Glitch9.AIDevKit.Provider.Google.dll
    Syntax
    public sealed class GeminiCandidate

    Properties

    | Edit this page View Source

    AvgLogprobs

    Output only. Average log probability score of the candidate.

    Declaration
    [JsonProperty("avgLogprobs")]
    public float? AvgLogprobs { get; set; }
    Property Value
    Type Description
    float?
    | Edit this page View Source

    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
    | Edit this page View Source

    Content

    Output only. Generated content returned from the model.

    Declaration
    [JsonProperty("content")]
    public GeminiContent Content { get; set; }
    Property Value
    Type Description
    GeminiContent
    | Edit this page View Source

    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?
    | Edit this page View Source

    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[]
    | Edit this page View Source

    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
    | Edit this page View Source

    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?
    | Edit this page View Source

    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
    | Edit this page View Source

    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[]
    | Edit this page View Source

    TokenCount

    Output only. Token count for this candidate.

    Declaration
    [JsonProperty("tokenCount")]
    public int TokenCount { get; set; }
    Property Value
    Type Description
    int
    | Edit this page View Source

    UrlContextMetadata

    Output only. Metadata related to url context retrieval tool.

    Declaration
    [JsonProperty("urlContextMetadata")]
    public UrlContextMetadata UrlContextMetadata { get; set; }
    Property Value
    Type Description
    UrlContextMetadata

    Extension Methods

    ArrayExtensions.ToArrayOrEmpty<T>(T)
    ArrayExtensions.ToArrayOrNull<T>(T)
    EventExtensions.ToDelta<T>(T, string, int, string, bool)
    EventExtensions.ToDone<T>(T, string, int, string)
    EventExtensions.ToEvent<T>(T)
    EventExtensions.UpcastDelta<T1, T2>(T1, string, int, string, bool)
    FallbackExtensions.IsOr<TParent, TChild>(TParent, TChild)
    ResponseCastingExtensions.GetResult<T>(T)
    SystemExtensions.GetName(object)
    • Edit this page
    • View Source
    In this article
    Back to top AI DevKit Documentation