Repository navigation
Conversation
…er (strands-agents#143) Extend TraceProvider with an optional, non-abstract list_sessions(SessionFilter) so backends that can enumerate sessions expose discovery, while the default raises NotImplementedError pointing at the known-session-id path. Add a SessionFilter pydantic model (start_time/end_time/limit + additional_fields). Add strands_evals.batch.evaluate_sessions(provider, evaluators, session_filter) that composes list_sessions -> Case-per-session -> Experiment.run, removing the discover/build/run boilerplate every provider user rewrites. It returns a single EvaluationReport to match the current Experiment API (flattened across evaluators), rather than the list[EvaluationReport] in the original sketch. Export SessionFilter and evaluate_sessions from the package root.
|
Task A base refresh: merged current |
|
Task A base refresh: merged current |
…sks/143 Co-authored-by: TRAE CLI <traecli@bytedance.com>
…sks/143 Co-authored-by: TRAE CLI <traecli@bytedance.com>
|
Task A base refresh: merged the latest Verification on the refreshed head:
I use a coding assistant to help implement, and I review and take responsibility for the final change. |
…sks/143 Co-authored-by: TRAE CLI <traecli@bytedance.com>
…sks/143 Co-authored-by: TRAE CLI <traecli@bytedance.com>
…sks/143 Co-authored-by: TRAE CLI <traecli@bytedance.com>
…sks/143 Co-authored-by: TRAE CLI <traecli@bytedance.com> # Conflicts: # src/strands_evals/__init__.py
…sks/143 Co-authored-by: TRAE CLI <traecli@bytedance.com>
…sks/143 Co-authored-by: TRAE CLI <traecli@bytedance.com>
Description
Closes #143.
Extends
TraceProviderwith optional session discovery and adds a batch helper so callers can evaluate every session matching a filter in one call, instead of hand-writing the discover → build cases → run boilerplate.What changed
SessionFilter(Pydantic model inproviders/trace_provider.py): universalstart_time/end_time/limitfields plusadditional_fields: dict[str, Any]for provider-specific criteria.TraceProvider.list_sessions(session_filter=None) -> Iterator[str]: intentionally not abstract. Providers override it only when their backend supports discovery; the default raisesNotImplementedErrorpointing at the known-session_idpath (get_evaluation_data). This keeps the bar low for providers that only accept externally-supplied session IDs — matching alternative Add InteractionsEvaluator for multi-agent and more complicated sequence-based evaluations. #1 rejected in the issue.strands_evals.batch.evaluate_sessions(provider, evaluators, session_filter=None, *, max_workers=1): composeslist_sessions→ oneCaseper session (keyed onsession_id) →Experiment, usingprovider.as_task()as the per-case task. A free function, not a method onExperiment/TraceProvider, to avoid the coupling/circular-dependency issues the issue calls out (alternatives Add styling fixes and license docs. #3 and Add support for dataset generation with strands agents #4).SessionFilterandevaluate_sessionsfrom the package root andproviderspackage.Deviation from the issue sketch
The issue sketched
evaluate_sessions(...) -> list[EvaluationReport]with a locally-definedExperiment+task. The current public API isExperiment.run_evaluations, which returns a singleEvaluationReportflattened across evaluators (each row tagged viacases[i]["evaluator"]). To match today's API I return oneEvaluationReport. Happy to change the shape if you'd prefer otherwise.max_workersdefaults to1(sequential) because aTracedHandlershares one exporter and some providers share a single network client.Related Issues
#143
Testing
hatch test tests/strands_evals/providers/ tests/strands_evals/test_batch.py→ 107 passed (includes the existing provider suites, plus newSessionFilter/list_sessions/evaluate_sessionstests).hatch test tests/strands_evals/providers/test_trace_provider.py tests/strands_evals/test_batch.py→ 21 passed.hatch fmt --formatterclean;hatch fmt --linter→ all checks passed.hatch run hatch-static-analysis:mypy -p src→ Success, no issues in 236 source files.New tests:
tests/strands_evals/test_batch.py(batch fan-out, per-session output routing, filter forwarding, empty discovery, NotImplementedError path) and addedTestSessionFilter/TestListSessionstotests/strands_evals/providers/test_trace_provider.py.Checklist
I use a coding assistant to help implement, and I review and take responsibility for the final change.