Package com.google.genai.types
Class ReinforcementTuningStringMatchRewardScorerStringMatchExpression
java.lang.Object
com.google.genai.JsonSerializable
com.google.genai.types.ReinforcementTuningStringMatchRewardScorerStringMatchExpression
public abstract class ReinforcementTuningStringMatchRewardScorerStringMatchExpression
extends JsonSerializable
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder for ReinforcementTuningStringMatchRewardScorerStringMatchExpression. -
Field Summary
Fields inherited from class com.google.genai.JsonSerializable
MAX_READ_LENGTH_PROPERTY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Instantiates a builder for ReinforcementTuningStringMatchRewardScorerStringMatchExpression.A string or a regular expression to match against for evaluating rewards.Deserializes a JSON string to a ReinforcementTuningStringMatchRewardScorerStringMatchExpression object.abstract Optional<MatchOperation>Match operation to use for evaluating rewards.Creates a builder with the same values as this instance.Methods inherited from class com.google.genai.JsonSerializable
fromJsonNode, fromJsonString, objectMapper, setMaxReadLength, stringToJsonNode, toJson, toJsonNode, toJsonString
-
Constructor Details
-
ReinforcementTuningStringMatchRewardScorerStringMatchExpression
public ReinforcementTuningStringMatchRewardScorerStringMatchExpression()
-
-
Method Details
-
matchOperation
Match operation to use for evaluating rewards. -
expression
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.*" } ``` -
builder
Instantiates a builder for ReinforcementTuningStringMatchRewardScorerStringMatchExpression. -
toBuilder
Creates a builder with the same values as this instance. -
fromJson
public static ReinforcementTuningStringMatchRewardScorerStringMatchExpression fromJson(String jsonString) Deserializes a JSON string to a ReinforcementTuningStringMatchRewardScorerStringMatchExpression object.
-