Class: Google::Apis::AiplatformV1::GoogleCloudAiplatformV1EvaluationParserConfigCustomCodeParserConfig
- Inherits:
-
Object
- Object
- Google::Apis::AiplatformV1::GoogleCloudAiplatformV1EvaluationParserConfigCustomCodeParserConfig
- 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
Configuration for parsing the LLM response using custom code.
Instance Attribute Summary collapse
-
#parsing_function ⇒ String
Required.
Instance Method Summary collapse
-
#initialize(**args) ⇒ GoogleCloudAiplatformV1EvaluationParserConfigCustomCodeParserConfig
constructor
A new instance of GoogleCloudAiplatformV1EvaluationParserConfigCustomCodeParserConfig.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ GoogleCloudAiplatformV1EvaluationParserConfigCustomCodeParserConfig
Returns a new instance of GoogleCloudAiplatformV1EvaluationParserConfigCustomCodeParserConfig.
9993 9994 9995 |
# File 'lib/google/apis/aiplatform_v1/classes.rb', line 9993 def initialize(**args) update!(**args) end |
Instance Attribute Details
#parsing_function ⇒ String
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
9991 9992 9993 |
# File 'lib/google/apis/aiplatform_v1/classes.rb', line 9991 def parsing_function @parsing_function end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
9998 9999 10000 |
# File 'lib/google/apis/aiplatform_v1/classes.rb', line 9998 def update!(**args) @parsing_function = args[:parsing_function] if args.key?(:parsing_function) end |