Class: Google::Apis::AiplatformV1beta1::GoogleCloudAiplatformV1beta1ReinforcementTuningExample
- Inherits:
-
Object
- Object
- Google::Apis::AiplatformV1beta1::GoogleCloudAiplatformV1beta1ReinforcementTuningExample
- 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
User-facing format for Gemini Reinforcement Tuning examples on Vertex.
Instance Attribute Summary collapse
-
#contents ⇒ Array<Google::Apis::AiplatformV1beta1::GoogleCloudAiplatformV1beta1Content>
Multi-turn contents that represents the Prompt.
-
#references ⇒ Hash<String,String>
References for the given prompt.
-
#system_instruction ⇒ Google::Apis::AiplatformV1beta1::GoogleCloudAiplatformV1beta1Content
The structured data content of a message.
-
#tools ⇒ Array<Google::Apis::AiplatformV1beta1::GoogleCloudAiplatformV1beta1Tool>
Optional.
Instance Method Summary collapse
-
#initialize(**args) ⇒ GoogleCloudAiplatformV1beta1ReinforcementTuningExample
constructor
A new instance of GoogleCloudAiplatformV1beta1ReinforcementTuningExample.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ GoogleCloudAiplatformV1beta1ReinforcementTuningExample
Returns a new instance of GoogleCloudAiplatformV1beta1ReinforcementTuningExample.
49488 49489 49490 |
# File 'lib/google/apis/aiplatform_v1beta1/classes.rb', line 49488 def initialize(**args) update!(**args) end |
Instance Attribute Details
#contents ⇒ Array<Google::Apis::AiplatformV1beta1::GoogleCloudAiplatformV1beta1Content>
Multi-turn contents that represents the Prompt.
Corresponds to the JSON property contents
49458 49459 49460 |
# File 'lib/google/apis/aiplatform_v1beta1/classes.rb', line 49458 def contents @contents end |
#references ⇒ Hash<String,String>
References for the given prompt. The key is the name of the reference, and the
value is the reference itself. Users can use this field together with the
reward configurations to calculate rewards for reinforcement tuning. For
example, users can set the following references: ` "concise_answer": "Yes",
"verbose_answer": "The answer is Yes" ` Then in a
ReinforcementTuningCodeExecutionRewardScorer reward function config, for
example, they can define a python code snippet as follows: def evaluate(
example, response) -> float: response_str = response.get("parts", [])0
references = example.get("references", ``) if response_str == references.get("
concise_answer"): return 1.0 return -1.0 In this case, references can
serve the purpose of holding the ground truth of this example in the training/
validation dataset.
Corresponds to the JSON property references
49474 49475 49476 |
# File 'lib/google/apis/aiplatform_v1beta1/classes.rb', line 49474 def references @references end |
#system_instruction ⇒ Google::Apis::AiplatformV1beta1::GoogleCloudAiplatformV1beta1Content
The structured data content of a message. A Content message contains a role
field, which indicates the producer of the content, and a parts field, which
contains the multi-part data of the message.
Corresponds to the JSON property systemInstruction
49481 49482 49483 |
# File 'lib/google/apis/aiplatform_v1beta1/classes.rb', line 49481 def system_instruction @system_instruction end |
#tools ⇒ Array<Google::Apis::AiplatformV1beta1::GoogleCloudAiplatformV1beta1Tool>
Optional. Corresponds to tools in user-facing GenerateContentRequest.
Corresponds to the JSON property tools
49486 49487 49488 |
# File 'lib/google/apis/aiplatform_v1beta1/classes.rb', line 49486 def tools @tools end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
49493 49494 49495 49496 49497 49498 |
# File 'lib/google/apis/aiplatform_v1beta1/classes.rb', line 49493 def update!(**args) @contents = args[:contents] if args.key?(:contents) @references = args[:references] if args.key?(:references) @system_instruction = args[:system_instruction] if args.key?(:system_instruction) @tools = args[:tools] if args.key?(:tools) end |