Table of Contents

Class ReinforcementTuningStringMatchRewardScorer

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

Scores parsed responses for string matching use cases.

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

Properties

CorrectAnswerReward

Correct answer reward is returned if evaluator evaluates to true. All correct answers get the same reward.

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

Property Value

double?

JsonMatchExpression

Uses json match expression to evaluate parsed response.

[JsonPropertyName("jsonMatchExpression")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public ReinforcementTuningStringMatchRewardScorerJsonMatchExpression? JsonMatchExpression { get; set; }

Property Value

ReinforcementTuningStringMatchRewardScorerJsonMatchExpression

StringMatchExpression

Uses string match expression to evaluate parsed response.

[JsonPropertyName("stringMatchExpression")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public ReinforcementTuningStringMatchRewardScorerStringMatchExpression? StringMatchExpression { get; set; }

Property Value

ReinforcementTuningStringMatchRewardScorerStringMatchExpression

WrongAnswerReward

Wrong answer reward is returned if evaluator evaluates to false. All wrong answers get the same reward.

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

Property Value

double?

Methods

FromJson(string, JsonSerializerOptions?)

Deserializes a JSON string to a ReinforcementTuningStringMatchRewardScorer object.

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

Parameters

jsonString string

The JSON string to deserialize.

options JsonSerializerOptions

Optional JsonSerializerOptions.

Returns

ReinforcementTuningStringMatchRewardScorer

The deserialized ReinforcementTuningStringMatchRewardScorer object, or null if deserialization fails.