Table of Contents

Class ValidateRewardResponse

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

Response for the validate_reward method. Contains the computed reward for a reinforcement tuning reward configuration.

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

Properties

Error

Output only. In case of an error, this field will be populated with a detailed error message to help with debugging.

[JsonPropertyName("error")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Error { get; set; }

Property Value

string

OverallReward

Output only. The overall weighted reward. For a CompositeReinforcementTuningRewardConfig, this is the weighted average of all rewards. For a SingleReinforcementTuningRewardConfig, this will be the value of the single reward.

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

Property Value

double?

RewardInfoDetails

A map from reward name to reward info.

[JsonPropertyName("rewardInfoDetails")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public Dictionary<string, ReinforcementTuningRewardInfo>? RewardInfoDetails { get; set; }

Property Value

Dictionary<string, ReinforcementTuningRewardInfo>

SdkHttpResponse

Used to retain the full HTTP response.

[JsonPropertyName("sdkHttpResponse")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public HttpResponse? SdkHttpResponse { get; set; }

Property Value

HttpResponse

Methods

FromJson(string, JsonSerializerOptions?)

Deserializes a JSON string to a ValidateRewardResponse object.

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

Parameters

jsonString string

The JSON string to deserialize.

options JsonSerializerOptions

Optional JsonSerializerOptions.

Returns

ValidateRewardResponse

The deserialized ValidateRewardResponse object, or null if deserialization fails.