Package dev.agenor.tools.eval
Class ScenarioRunner
java.lang.Object
dev.agenor.tools.eval.ScenarioRunner
Executes evaluation scenarios against a Agenor runtime.
The runner orchestrates the complete evaluation lifecycle:
- Setup - prepare the runtime environment
- Execute - trigger agent behavior
- Collect - gather metrics, health status, messages
- Verify - run assertions against collected data
- Teardown - cleanup resources
Reuses existing Agenor tools services:
MetricsService- for metrics collectionHealthCheckService- for health verificationMessageHistoryService- for message tracking
Example usage:
AgenorRuntime runtime = AgenorRuntime.create();
ScenarioRunner runner = new ScenarioRunner(runtime);
EvaluationResult result = runner.run(myScenario);
if (result.passed()) {
System.out.println("All assertions passed!");
} else {
result.failedAssertions().forEach(System.out::println);
}
- Since:
- 0.5.0
-
Constructor Summary
ConstructorsConstructorDescriptionScenarioRunner(AgenorRuntime runtime) Creates a runner with a new set of services.ScenarioRunner(AgenorRuntime runtime, int historySize) Creates a runner with custom message history size.ScenarioRunner(AgenorRuntime runtime, MetricsService metrics, HealthCheckService health, MessageHistoryService history) Creates a runner with externally provided services. -
Method Summary
Modifier and TypeMethodDescriptioncreateReport(List<EvaluationResult> results) Creates an evaluation report from results.Runs a single scenario.Runs multiple scenarios and returns all results.runAllParallel(List<Scenario> scenarios) Runs multiple scenarios in parallel.voidshutdown()Shuts down the runner and releases resources.
-
Constructor Details
-
ScenarioRunner
Creates a runner with a new set of services.- Parameters:
runtime- the Agenor runtime to evaluate
-
ScenarioRunner
Creates a runner with custom message history size.- Parameters:
runtime- the Agenor runtime to evaluatehistorySize- maximum messages to retain
-
ScenarioRunner
public ScenarioRunner(AgenorRuntime runtime, MetricsService metrics, HealthCheckService health, MessageHistoryService history) Creates a runner with externally provided services.- Parameters:
runtime- the Agenor runtimemetrics- metrics servicehealth- health check servicehistory- message history service
-
-
Method Details
-
run
Runs a single scenario.- Parameters:
scenario- the scenario to run- Returns:
- evaluation result
-
runAll
Runs multiple scenarios and returns all results.- Parameters:
scenarios- scenarios to run- Returns:
- list of results in order
-
runAllParallel
Runs multiple scenarios in parallel.- Parameters:
scenarios- scenarios to run- Returns:
- list of results (order may vary)
-
createReport
Creates an evaluation report from results.- Parameters:
results- evaluation results- Returns:
- formatted report
-
shutdown
public void shutdown()Shuts down the runner and releases resources.
-