Table of Contents

Class GeminiPreferenceExample

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

Input example for preference optimization. This data type is not supported in Gemini API.

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

Properties

Completions

List of completions for a given prompt.

[JsonPropertyName("completions")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public List<GeminiPreferenceExampleCompletion>? Completions { get; set; }

Property Value

List<GeminiPreferenceExampleCompletion>

Contents

Multi-turn contents that represents the Prompt.

[JsonPropertyName("contents")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public List<Content>? Contents { get; set; }

Property Value

List<Content>

Methods

FromJson(string, JsonSerializerOptions?)

Deserializes a JSON string to a GeminiPreferenceExample object.

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

Parameters

jsonString string

The JSON string to deserialize.

options JsonSerializerOptions

Optional JsonSerializerOptions.

Returns

GeminiPreferenceExample

The deserialized GeminiPreferenceExample object, or null if deserialization fails.