Table of Contents

Class GeminiPreferenceExampleCompletion

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

Completion and its preference score. This data type is not supported in Gemini API.

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

Properties

Completion

Single turn completion for the given prompt.

[JsonPropertyName("completion")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public Content? Completion { get; set; }

Property Value

Content

Score

The score for the given completion.

[JsonPropertyName("score")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public double? Score { get; set; }

Property Value

double?

Methods

FromJson(string, JsonSerializerOptions?)

Deserializes a JSON string to a GeminiPreferenceExampleCompletion object.

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

Parameters

jsonString string

The JSON string to deserialize.

options JsonSerializerOptions

Optional JsonSerializerOptions.

Returns

GeminiPreferenceExampleCompletion

The deserialized GeminiPreferenceExampleCompletion object, or null if deserialization fails.