aggregationFunction property

String? aggregationFunction
getter/setter pair

The Python code string containing the aggregation function.

Expected function signature: def aggregate(instances: list[dict[str, Any]]) -> dict[str, float]: The instances argument is a list of dictionaries, where each dictionary represents a single evaluation result item. The structure of each dictionary corresponds to the fields in the EvaluationResult message. This includes: - "request": Contains the original input data and model inputs (from EvaluationResult.EvaluationRequest). - "candidate_results": Contains the results of any instance-level metrics (from EvaluationResult.CandidateResults). Example of a single item in the instances list: { "request": { "prompt": {"text": "What is the capital of France?"}, "golden_response": {"text": "Paris"}, "candidate_responses": [{"candidate": "model-v1", "text": "Paris"}] }, "candidate_results": [ {"metric": "exact_match", "score": 1.0}, {"metric": "bleu", "score": 0.9} ] }

Required.

Implementation

core.String? aggregationFunction;