ReinforcementTuningStringMatchRewardScorerStringMatchExpression

@Serializable
data class ReinforcementTuningStringMatchRewardScorerStringMatchExpression(val matchOperation: MatchOperation? = null, val expression: String? = null)

Evaluates parsed response using match type against the expression. Returns true if MatchOperation(target, expression) evaluates to true, and false otherwise. This data type is not supported in Gemini API.

Constructors

constructor(matchOperation: MatchOperation? = null, expression: String? = null)

Properties

Link copied to clipboard
val expression: String? = null

A string or a regular expression to match against for evaluating rewards. Users can also provide a references map of {key: value} whose value will be used to replace the placeholder {{references.key}} in the expression. For example, if the following references are defined in the training / validation dataset: `` { "systemInstruction": ..., "contents": ..., "references": { "concise_answer": "Yes", "verbose_answer": "The answer is Yes" } } `` and if users define the following StringMatchExpression: { "matchOperation": "REGEX_CONTAINS", "expression": ".{{references.concise_answer}}." } On evaluating the reward for each sample response, this StringMatchExpression will be substituted as: `` { "matchOperation": "REGEX_CONTAINS", "expression": ".*Yes.*" } ``

Link copied to clipboard

Match operation to use for evaluating rewards.