google.adk.evaluation.agent_evaluator.AgentEvaluator
https://github.com/google/adk-python/blob/v1.21.0/src/google/adk/evaluation/agent_evaluator.py#L97
An evaluator for Agents, mainly intended for helping with test cases.
evaluate() https://github.com/google/adk-python/blob/v1.21.0/src/google/adk/evaluation/agent_evaluator.py#L196
agent_moduleをimportlib.import_moduleする
_get_agent_for_eval() https://github.com/google/adk-python/blob/v1.21.0/src/google/adk/evaluation/agent_evaluator.py#L483
root_agent
なければawait get_agent_async()(AgentEvaluator限定ロジック)
eval_dataset_file_path_or_dirから.test.jsonを見つける
test_config.json もサポートしている
find_config_for_test_file() https://github.com/google/adk-python/blob/main/src/google/adk/evaluation/agent_evaluator.py#L104
initial_session_file
IMO:どういう形式なんだろう?
session_inputが登場した模様 https://github.com/google/adk-python/blob/v1.21.0/tests/integration/fixture/trip_planner_agent/test_files/trip_inquiry_sub_agent.test.json#L50-L59
evaluate_eval_set() を呼び出す
evaluate_eval_set() https://github.com/google/adk-python/blob/main/src/google/adk/evaluation/agent_evaluator.py#L108
Step 1: Perform evals, basically inferencing and evaluation of metrics
google.adk.evaluation.eval_config.get_eval_metrics_from_config()
AgentEvaluator._get_eval_results_by_eval_id() (下へ)
Step 2: Post-process the results!
_get_eval_metric_results_with_invocation()
Returns _EvalMetricResultWithInvocation grouped by metric.
_process_metrics_and_get_failures()
Returns a list of failures based on the score for each invocation.
assert not failures, failure_message
pytestで実行すると、テストレポートで見える
_get_eval_results_by_eval_id() https://github.com/google/adk-python/blob/v1.23.0/src/google/adk/evaluation/agent_evaluator.py#L533
Returns EvalCaseResults grouped by eval case id.
google.adk.evaluation.local_eval_service.LocalEvalServiceを作って実行
serviceでmetricのPythonモジュールの読み込みなど
num_runsを考慮してinferenceしてevaluate