pub struct EvalRunner { /* private fields */ }Expand description
Evaluation runner using Orchestrator directly
§Example
let runner = EvalRunner::new(scenario, runtime.handle().clone())
.with_runs(5)
.with_seed(42)
.with_task(SwarmTask::new("Find the auth handler"))
.with_manager_factory(|| Box::new(MyManager::new()))
.with_batch_invoker_factory(|| Box::new(MyInvoker::new()));
let report = runner.run()?;Implementations§
Source§impl EvalRunner
impl EvalRunner
pub fn new(scenario: EvalScenario, runtime: Handle) -> Self
Sourcepub fn with_verbose(self, verbose: bool) -> Self
pub fn with_verbose(self, verbose: bool) -> Self
Enable verbose output (print tick snapshots)
Sourcepub fn with_exploration(self, enable: bool) -> Self
pub fn with_exploration(self, enable: bool) -> Self
Enable ExplorationSpace tracking
Sourcepub fn with_dependency_graph(self, graph: DependencyGraph) -> Self
pub fn with_dependency_graph(self, graph: DependencyGraph) -> Self
Set dependency graph for action sequencing
The graph defines valid action transitions and terminal conditions. When set, actions will be filtered based on the graph structure.
Sourcepub fn with_action_events_path(self, path: impl Into<PathBuf>) -> Self
pub fn with_action_events_path(self, path: impl Into<PathBuf>) -> Self
Set path to save action events (JSONL format)
When set, all action events will be saved to the specified path. Each run will append to a file with the run index suffix.
§Example
runner.with_action_events_path("./logs/events.jsonl")
// Creates: ./logs/events_run0.jsonl, ./logs/events_run1.jsonl, ...Sourcepub fn with_learning_store(self, path: impl AsRef<Path>) -> Self
pub fn with_learning_store(self, path: impl AsRef<Path>) -> Self
Sourcepub fn with_train_trigger(self, trigger: Arc<dyn TrainTrigger>) -> Self
pub fn with_train_trigger(self, trigger: Arc<dyn TrainTrigger>) -> Self
Set TrainTrigger for Learning
Controls when offline learning is executed after eval runs. Default: Learn after every run (if learning_store is configured).
§Example
use swarm_engine_core::learn::CountTrigger;
// Run learning after every 5 eval iterations
runner.with_train_trigger(Arc::new(CountTrigger::new(5)))pub fn with_runs(self, runs: usize) -> Self
pub fn with_seed(self, seed: u64) -> Self
Sourcepub fn with_manager_factory<F>(self, factory: F) -> Self
pub fn with_manager_factory<F>(self, factory: F) -> Self
Set manager factory (creates new Manager for each run)
Sourcepub fn with_batch_invoker_factory<F>(self, factory: F) -> Self
pub fn with_batch_invoker_factory<F>(self, factory: F) -> Self
Set batch invoker factory (creates new BatchInvoker for each run)
Sourcepub fn with_extensions_factory<F>(self, factory: F) -> Self
pub fn with_extensions_factory<F>(self, factory: F) -> Self
Set extensions factory (creates new Extensions for each run)
Sourcepub fn with_operator_provider_factory<F>(self, factory: F) -> Self
pub fn with_operator_provider_factory<F>(self, factory: F) -> Self
Set OperatorProvider factory (creates new provider for each run)
Use this to configure the Selection strategy for exploration.
Default is AdaptiveProvider if not specified.
§Example
use swarm_engine_core::exploration::{HybridLlmProvider, ReviewPolicy};
use swarm_engine_llm::LlmStrategyAdvisor;
runner.with_operator_provider_factory(|| {
let advisor = LlmStrategyAdvisor::new(decider.clone(), handle.clone());
let policy = ReviewPolicy::default();
Box::new(HybridLlmProvider::new(advisor, policy))
})pub fn run(&self) -> Result<EvalReport>
Auto Trait Implementations§
impl Freeze for EvalRunner
impl !RefUnwindSafe for EvalRunner
impl Send for EvalRunner
impl Sync for EvalRunner
impl Unpin for EvalRunner
impl !UnwindSafe for EvalRunner
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more