Skip to content

Commit 6e4013e

Browse files
committed
test: Enable tool call evaluator
1 parent 22c3b5b commit 6e4013e

3 files changed

Lines changed: 7 additions & 3 deletions

File tree

e2e_tests/python/main.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import json
22
import logging
33
import os
4+
import sys
45
from typing import Any
56

67
from botocore.config import Config
@@ -150,6 +151,10 @@ def task_fn(case: Case) -> TaskOutput:
150151
print(f"Reasons: {report.reasons}")
151152
print(f"Tools called: {called_tools}")
152153

154+
# Exit with non-zero code if test fails
155+
if not report.test_passes:
156+
sys.exit(1)
157+
153158

154159
if __name__ == "__main__":
155160
main()

e2e_tests/python/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
strands-agents==1.15.0
2-
strands-agents-evals==0.1.0
2+
strands-agents-evals==0.1.1
33
mcp==1.23.1
44
uvicorn==0.38.0
55
boto3==1.42.3

e2e_tests/python/tool_call_evaluator.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ def evaluate(self, evaluation_case: EvaluationData[InputT, OutputT]) -> list[Eva
2626

2727
for event in evaluation_case.actual_trajectory:
2828
if isinstance(event, dict) and 'name' in event:
29-
result = event.get('tool_result', '')
30-
if isinstance(result, str) and result.startswith('Error:'):
29+
if event.get('is_error', False):
3130
tool_errors.append(event['name'])
3231
else:
3332
tool_successes.add(event['name'])

0 commit comments

Comments
 (0)