Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions src/strands_evals/evaluators/evaluator.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import asyncio
import inspect
import logging

Expand Down Expand Up @@ -95,15 +96,13 @@ async def evaluate_async(self, evaluation_case: EvaluationData[InputT, OutputT])
"""
Evaluate the performance of the task on the given test cases asynchronously.

Delegates to evaluate() via asyncio.to_thread by default, ensuring subclasses
that only implement evaluate() work in the async path.

Args:
evaluation_case: The test case with all of the neccessary context to be evaluated.

Raises:
NotImplementedError: This method is not implemented in the base class.
"""
raise NotImplementedError(
"This method should be implemented in subclasses, especially if you want to run evaluations asynchronously."
)
return await asyncio.to_thread(self.evaluate, evaluation_case)

def _parse_trajectory(self, evaluation_case: EvaluationData[InputT, OutputT]) -> Any:
"""Parse Session trajectory using TraceExtractor."""
Expand Down
Loading