Class: Google::Apis::AiplatformV1beta1::GoogleCloudAiplatformV1beta1EvaluationParserConfigCustomCodeParserConfig

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

Configuration for parsing the LLM response using custom code.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleCloudAiplatformV1beta1EvaluationParserConfigCustomCodeParserConfig

Returns a new instance of GoogleCloudAiplatformV1beta1EvaluationParserConfigCustomCodeParserConfig.



19413
19414
19415
# File 'lib/google/apis/aiplatform_v1beta1/classes.rb', line 19413

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

Instance Attribute Details

#code_execution_regionString

Optional. The region to use for code execution. If set, the Code Execution Sandbox will be invoked in the specified region regardless of the request's originating region. Must be a region where the Code Execution Sandbox is available. Supported regions: us-central1, us-east1, us-east4, us-west1, us- west4, southamerica-east1, europe-west2, europe-west3, asia-east1, asia-south1, asia-southeast1. If unset, the request's originating region is used. Corresponds to the JSON property codeExecutionRegion

Returns:

  • (String)


19394
19395
19396
# File 'lib/google/apis/aiplatform_v1beta1/classes.rb', line 19394

def code_execution_region
  @code_execution_region
end

#parsing_functionString

Required. Python function for parsing results. The function should be defined within this string. The function takes a list of strings (LLM responses) and should return either a list of dictionaries (for rubrics) or a single dictionary (for a metric result). Example function signature: def parse( responses: list[str]) -> list[dict[str, Any]] | dict[str, Any]: When parsing rubrics, return a list of dictionaries, where each dictionary represents a Rubric. Example for rubrics: [ "content":"property": "description": "The response is factual.", "type": "FACTUALITY", "importance": "HIGH", " content":"property": "description": "The response is fluent.", "type": " FLUENCY", "importance": "MEDIUM" ] When parsing critique results, return a dictionary representing a MetricResult. Example for a metric result: "score": 0.8, "explanation": "The model followed most instructions.", "rubric_verdicts" : [...] ... code for result extraction and aggregation Corresponds to the JSON property parsingFunction

Returns:

  • (String)


19411
19412
19413
# File 'lib/google/apis/aiplatform_v1beta1/classes.rb', line 19411

def parsing_function
  @parsing_function
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



19418
19419
19420
19421
# File 'lib/google/apis/aiplatform_v1beta1/classes.rb', line 19418

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