ReinforcementTuningStringMatchRewardScorer

@Serializable
data class ReinforcementTuningStringMatchRewardScorer(val wrongAnswerReward: Double? = null, val correctAnswerReward: Double? = null, val stringMatchExpression: ReinforcementTuningStringMatchRewardScorerStringMatchExpression? = null, val jsonMatchExpression: ReinforcementTuningStringMatchRewardScorerJsonMatchExpression? = null)

ReinforcementTuningStringMatchRewardScorer is used to score parsed responses for string matching use cases. For example, for math problems, users can use string match scorer to check if the correct exact answer is generated. Note: Reward returned by the string match reward function is clipped to be within [-1, 1] if wrongAnswerReward or correctAnswerReward are beyond the range, i.e., reward = max(min(reward, 1.0), -1.0). This data type is not supported in Gemini API.

Constructors

constructor(wrongAnswerReward: Double? = null, correctAnswerReward: Double? = null, stringMatchExpression: ReinforcementTuningStringMatchRewardScorerStringMatchExpression? = null, jsonMatchExpression: ReinforcementTuningStringMatchRewardScorerJsonMatchExpression? = null)

Properties

Link copied to clipboard

Correct answer rewawrd is returned if the parsed response is evaluated as true. All correct answers get the same reward.

Link copied to clipboard

Uses json match expression to evaluate parsed response.

Link copied to clipboard

Uses string match expression to evaluate parsed response.

Link copied to clipboard

Wrong answer reward is returned if the parsed response is evaluated as false. All wrong answers get the same reward.