Table of Contents

Class LogprobsResultTopCandidates

Namespace
Google.GenAI.Types
Assembly
Google.GenAI.dll

A list of the top candidate tokens and their log probabilities at each decoding step. This can be used to see what other tokens the model considered.

public record LogprobsResultTopCandidates : IEquatable<LogprobsResultTopCandidates>
Inheritance
LogprobsResultTopCandidates
Implements
Inherited Members

Properties

Candidates

The list of candidate tokens, sorted by log probability in descending order.

[JsonPropertyName("candidates")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public List<LogprobsResultCandidate>? Candidates { get; set; }

Property Value

List<LogprobsResultCandidate>

Methods

FromJson(string, JsonSerializerOptions?)

Deserializes a JSON string to a LogprobsResultTopCandidates object.

public static LogprobsResultTopCandidates? FromJson(string jsonString, JsonSerializerOptions? options = null)

Parameters

jsonString string

The JSON string to deserialize.

options JsonSerializerOptions

Optional JsonSerializerOptions.

Returns

LogprobsResultTopCandidates

The deserialized LogprobsResultTopCandidates object, or null if deserialization fails.