Class: Google::Apis::AiplatformV1::GoogleCloudAiplatformV1LlmBasedMetricSpec

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

Overview

Specification for an LLM based metric.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleCloudAiplatformV1LlmBasedMetricSpec

Returns a new instance of GoogleCloudAiplatformV1LlmBasedMetricSpec.



20773
20774
20775
# File 'lib/google/apis/aiplatform_v1/classes.rb', line 20773

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

Instance Attribute Details

#additional_configHash<String,Object>

Optional. Optional additional configuration for the metric. Corresponds to the JSON property additionalConfig

Returns:

  • (Hash<String,Object>)


20733
20734
20735
# File 'lib/google/apis/aiplatform_v1/classes.rb', line 20733

def additional_config
  @additional_config
end

#judge_autorater_configGoogle::Apis::AiplatformV1::GoogleCloudAiplatformV1AutoraterConfig

The configs for autorater. This is applicable to both EvaluateInstances and EvaluateDataset. Corresponds to the JSON property judgeAutoraterConfig



20739
20740
20741
# File 'lib/google/apis/aiplatform_v1/classes.rb', line 20739

def judge_autorater_config
  @judge_autorater_config
end

#metric_prompt_templateString

Required. Template for the prompt sent to the judge model. Corresponds to the JSON property metricPromptTemplate

Returns:

  • (String)


20744
20745
20746
# File 'lib/google/apis/aiplatform_v1/classes.rb', line 20744

def metric_prompt_template
  @metric_prompt_template
end

#predefined_rubric_generation_specGoogle::Apis::AiplatformV1::GoogleCloudAiplatformV1PredefinedMetricSpec

The spec for a pre-defined metric. Corresponds to the JSON property predefinedRubricGenerationSpec



20749
20750
20751
# File 'lib/google/apis/aiplatform_v1/classes.rb', line 20749

def predefined_rubric_generation_spec
  @predefined_rubric_generation_spec
end

#result_parser_configGoogle::Apis::AiplatformV1::GoogleCloudAiplatformV1EvaluationParserConfig

Config for parsing LLM responses. It can be used to parse the LLM response to be evaluated, or the LLM response from LLM-based metrics/Autoraters. Corresponds to the JSON property resultParserConfig



20755
20756
20757
# File 'lib/google/apis/aiplatform_v1/classes.rb', line 20755

def result_parser_config
  @result_parser_config
end

#rubric_generation_specGoogle::Apis::AiplatformV1::GoogleCloudAiplatformV1RubricGenerationSpec

Specification for how rubrics should be generated. Corresponds to the JSON property rubricGenerationSpec



20760
20761
20762
# File 'lib/google/apis/aiplatform_v1/classes.rb', line 20760

def rubric_generation_spec
  @rubric_generation_spec
end

#rubric_group_keyString

Use a pre-defined group of rubrics associated with the input. Refers to a key in the rubric_groups map of EvaluationInstance. Corresponds to the JSON property rubricGroupKey

Returns:

  • (String)


20766
20767
20768
# File 'lib/google/apis/aiplatform_v1/classes.rb', line 20766

def rubric_group_key
  @rubric_group_key
end

#system_instructionString

Optional. System instructions for the judge model. Corresponds to the JSON property systemInstruction

Returns:

  • (String)


20771
20772
20773
# File 'lib/google/apis/aiplatform_v1/classes.rb', line 20771

def system_instruction
  @system_instruction
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



20778
20779
20780
20781
20782
20783
20784
20785
20786
20787
# File 'lib/google/apis/aiplatform_v1/classes.rb', line 20778

def update!(**args)
  @additional_config = args[:additional_config] if args.key?(:additional_config)
  @judge_autorater_config = args[:judge_autorater_config] if args.key?(:judge_autorater_config)
  @metric_prompt_template = args[:metric_prompt_template] if args.key?(:metric_prompt_template)
  @predefined_rubric_generation_spec = args[:predefined_rubric_generation_spec] if args.key?(:predefined_rubric_generation_spec)
  @result_parser_config = args[:result_parser_config] if args.key?(:result_parser_config)
  @rubric_generation_spec = args[:rubric_generation_spec] if args.key?(:rubric_generation_spec)
  @rubric_group_key = args[:rubric_group_key] if args.key?(:rubric_group_key)
  @system_instruction = args[:system_instruction] if args.key?(:system_instruction)
end