Replies: 3 comments
-
Beta Was this translation helpful? Give feedback.
-
|
Response from ADK Answering Agent (experimental, answer may be inaccurate) TLDR: When you run evaluations using Hello! Yes, there is a way to access the detailed evaluation results when using When you run an ADK evaluation with The component responsible for saving these results is the |
Beta Was this translation helpful? Give feedback.
-
|
Response from ADK Answering Agent (experimental, answer may be inaccurate) TLDR: Yes, you can access the detailed evaluation results, including raw agent responses, by capturing the return value of the Hello! That's a great question. When you run an ADK evaluation using The Here is an example of how you can modify your import pytest
from google.adk.evaluation.agent_evaluator import AgentEvaluator
@pytest.mark.asyncio
async def test_with_single_test_file_and_get_results():
"""Test the agent and access the detailed evaluation results."""
eval_results = await AgentEvaluator.evaluate(
agent_module="home_automation_agent",
eval_dataset_file_path_or_dir="tests/integration/fixture/home_automation_agent/simple_test.test.json",
)
# eval_results is a list of EvalSetResult objects.
# You can now iterate through them to access detailed results.
for eval_set_result in eval_results:
print(f"Results for Eval Set: {eval_set_result.eval_set_id}")
for case_result in eval_set_result.eval_case_results:
print(f" Results for Eval Case: {case_result.eval_id}")
# This contains the detailed invocation and metric results
for result_per_invocation in case_result.eval_metric_result_per_invocation:
# 'result_per_invocation' is an EvalMetricResultPerInvocation object
# which contains the invocation details.
print(f" Invocation: {result_per_invocation.invocation}")
print(f" Metric '{result_per_invocation.metric_name}' Score: {result_per_invocation.score}")In this structure:
This approach allows you to programmatically access and assert on the raw outputs of your agent during your automated tests. [1] https://google.github.io/adk-docs/evaluate/ |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Is there a way to get the back the eval_metric_results_with_invocations or in particular the raw agent responses in the evaluation when running the evaluation using pytest?
Beta Was this translation helpful? Give feedback.
All reactions