Package com.google.genai.types
Class ReinforcementTuningParseResponseConfig
java.lang.Object
com.google.genai.JsonSerializable
com.google.genai.types.ReinforcementTuningParseResponseConfig
Defines how to parse sample response config for reinforcement tuning. The parsed response (i.e.,
substring) will be passed to the reward functions. For example, the input prompt might be: >
"Perform step-by-step thoughts first to problem A, finally output answer in the <ans>
</ans> block." The sample response from the model under tuning might look like: >
"<ans>Yes</ans>" Here, users can define the following parse config: ``` {
"parseType": "REGEX_EXTRACT", "regexExtractExpression": ".*(.*?)" } ``` The resulting parsed
response would be `"Yes"` and will be passed to the reward functions for evaluating rewards. This
data type is not supported in Gemini API.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder for ReinforcementTuningParseResponseConfig. -
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 ReinforcementTuningParseResponseConfig.Deserializes a JSON string to a ReinforcementTuningParseResponseConfig object.abstract Optional<ResponseParseType>Defines the type for parsing sample response.Defines the regex for extracting the important part of sample response.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
-
ReinforcementTuningParseResponseConfig
public ReinforcementTuningParseResponseConfig()
-
-
Method Details
-
parseType
Defines the type for parsing sample response. -
regexExtractExpression
Defines the regex for extracting the important part of sample response. This field is only used when parse_type is ResponseParseType.REGEX_EXTRACT. -
builder
Instantiates a builder for ReinforcementTuningParseResponseConfig. -
toBuilder
Creates a builder with the same values as this instance. -
fromJson
Deserializes a JSON string to a ReinforcementTuningParseResponseConfig object.
-