1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//! User-supplied agent invocation contract.
use Future;
use crateResult;
use crateSkillTask;
use crateTranscript;
/// Runs one trial of one task and returns the captured [`Transcript`].
///
/// Implementations own whatever agent / harness is under test. The
/// [`SkillHarness`](crate::skills::SkillHarness) calls
/// [`AgentRunner::run`] exactly once per `(task, trial)` pair, so the
/// implementation is the right place to enforce isolation: a fresh memory,
/// a clean working directory, a new agent instance — anything the
/// Anthropic and Claude playbooks call "clean context per trial."
///
/// ```no_run
/// use std::future::Future;
/// use rig_retrieval_evals::skills::{AgentRunner, SkillTask, Transcript};
/// use rig_retrieval_evals::Result;
///
/// struct EchoRunner;
///
/// impl AgentRunner for EchoRunner {
/// fn run(
/// &self,
/// task: &SkillTask,
/// _trial: usize,
/// ) -> impl Future<Output = Result<Transcript>> + Send {
/// let prompt = task.prompt.clone();
/// async move {
/// Ok(Transcript {
/// prompt: prompt.clone(),
/// final_output: prompt,
/// ..Default::default()
/// })
/// }
/// }
/// }
/// ```