Class: Google::Apis::AiplatformV1beta1::GoogleCloudAiplatformV1beta1ReinforcementTuningParseResponseConfig

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/aiplatform_v1beta1/classes.rb,
lib/google/apis/aiplatform_v1beta1/representations.rb,
lib/google/apis/aiplatform_v1beta1/representations.rb

Overview

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 block." The sample response from the model under tuning might look like: > "Yes" 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.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleCloudAiplatformV1beta1ReinforcementTuningParseResponseConfig

Returns a new instance of GoogleCloudAiplatformV1beta1ReinforcementTuningParseResponseConfig.



47280
47281
47282
# File 'lib/google/apis/aiplatform_v1beta1/classes.rb', line 47280

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#parse_typeString

Defines the type for parsing sample response. Corresponds to the JSON property parseType

Returns:

  • (String)


47272
47273
47274
# File 'lib/google/apis/aiplatform_v1beta1/classes.rb', line 47272

def parse_type
  @parse_type
end

#regex_extract_expressionString

Defines the regex for extracting the important part of sample response. This field is only used when parse_type is ResponseParseType.REGEX_EXTRACT. Corresponds to the JSON property regexExtractExpression

Returns:

  • (String)


47278
47279
47280
# File 'lib/google/apis/aiplatform_v1beta1/classes.rb', line 47278

def regex_extract_expression
  @regex_extract_expression
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



47285
47286
47287
47288
# File 'lib/google/apis/aiplatform_v1beta1/classes.rb', line 47285

def update!(**args)
  @parse_type = args[:parse_type] if args.key?(:parse_type)
  @regex_extract_expression = args[:regex_extract_expression] if args.key?(:regex_extract_expression)
end