Cases and runners
A case is one input to test. A runner takes a case, calls your system, and returns whatever it got back.
The samples here come from the Sentry triage example, where an agent gets an alert and has to find the Sentry issue behind it and the function to fix.
Cases
from eac import Case
JUDGES = [FoundIssueJudge(), FoundCauseJudge(), TriageLLMJudge()] # your own judges, see Judges
OFFLINE_CASES = [
Case(
name="coupon",
input={"alert": "Since {release} went out, customers say checkout fails when they use a coupon code."},
expected_output={"error": "coupon", "function": "apply_coupon"},
seeds=[Incident()],
judges=JUDGES,
),
Case(
name="false_alarm",
input={"alert": "A customer says checkout has been broken since {release}. Is it?"},
expected_output={"error": None, "function": None},
seeds=[Incident()],
judges=JUDGES,
),
]A case also has run_results, which is what your system returned, and seed_results, what each of its seeds' setup() returned, by seed name. eac fills in seed_results before your runner runs and run_results after, so your runner and judges can read them.
A few other options you might want:
seeds=[...]for fixtures the case needs. See Seeds.enabled=Falseto skip a case unless you ask for it by name.splits=["smoke"]to group cases, then run a group with--split smoke.
Prefer keeping cases in data files? from_jsonl("cases/*.jsonl", judges=[...]) loads one case per line.
Runners
from eac import Case, OfflineRunner
class OfflineTriageRunner(OfflineRunner):
credentials = [OpenRouterKey(), SentryLogin()]
def run_case(
self,
case: Case,
*,
conversation_id: str,
) -> dict[str, Any]:
alert = case.input["alert"].format(release=case.seed_results["incident"]["release"])
model = self.args.get("model", DEFAULT_MODEL)
return triage(alert, conversation_id=conversation_id, model=model)Return plain JSON and leave the scoring to your judges. Here the seed made a new release, so the runner reads it from case.seed_results and puts it in the alert. Along with the case, you get:
conversation_idto tag your agent's run, so judges can find its trace later.self.args, whatever was passed with--args, as a plain dict. eac doesn't check it, so check anything you rely on.
credentials lists what the runner needs, which eac checks before running anything. See Credentials.
To run the same cases against two models or agents, see Comparing variants.