feat: Update adk eval cli to consume custom metrics by adding CustomMetricEvaluator

Co-authored-by: Joseph Pagadora <jcpagadora@google.com>
PiperOrigin-RevId: 857229167
This commit is contained in:
Joseph Pagadora
2026-01-16 11:05:52 -08:00
committed by Copybara-Service
parent 5923da786e
commit ea0934b993
6 changed files with 201 additions and 28 deletions
+10 -4
View File
@@ -109,8 +109,12 @@ def test_get_eval_metrics_from_config_with_custom_metrics():
},
},
custom_metrics={
"custom_metric_1": {"name": "path/to/custom/metric_1"},
"custom_metric_2": {"name": "path/to/custom/metric_2"},
"custom_metric_1": {
"code_config": {"name": "path/to/custom/metric_1"},
},
"custom_metric_2": {
"code_config": {"name": "path/to/custom/metric_2"},
},
},
)
eval_metrics = get_eval_metrics_from_config(eval_config)
@@ -128,10 +132,12 @@ def test_get_eval_metrics_from_config_with_custom_metrics():
def test_custom_metric_code_config_with_args_raises_error():
with pytest.raises(ValueError):
eval_config = EvalConfig(
_ = EvalConfig(
criteria={"custom_metric": 1.0},
custom_metrics={
"custom_metric": {"name": "name", "args": [{"value": 1}]}
"custom_metric": {
"code_config": {"name": "name", "args": [{"value": 1}]},
}
},
)