Skip to main content

Crate mira_everruns

Crate mira_everruns 

Source
Expand description

Mira Subject adapter for everruns-runtime.

RuntimeSubject drives a real InProcessRuntime session for each sample — the in-process path to evaluating everruns-based agents (the canonical migration target for everruns’ llm-tests and the everruns coding CLI).

Mira’s core stays provider-agnostic: a Target carries only (provider, model) labels. The embedder owns runtime/driver/tool wiring via a RuntimeFactory closure that maps a Target onto a built runtime and the session to drive. This crate just normalizes the runtime’s TurnResult and Event stream into a Mira Transcript, so every Mira scorer and report works unchanged.

use std::sync::Arc;
use mira::{Eval, scorer::contains};
use mira_everruns::RuntimeSubject;

// The embedder builds a runtime for each matrix case (provider/model from
// the Target) and returns it with the session id to drive.
let subject = RuntimeSubject::new(|model| Box::pin(async move {
    // ... construct an InProcessRuntime registering a driver for
    // `target.provider` / `target.model`, then return (runtime, session_id).
}));

let _eval = Eval::new("greet")
    .sample("hi", "Say hi and tell me the answer.")
    .subject(subject)
    .scorer(contains("42"));

See mira_everruns::target_to_resolved for mapping a Target onto an everruns ResolvedModel inside your factory.

Structs§

RuntimeSubject
Drives a real everruns-runtime session: sends each input turn, then normalizes TurnResult + the event stream into a Mira Transcript.

Functions§

atif_from_events
Fold a typed everruns Event stream into an ATIF Trajectory — one agent step per reasoning iteration (reason.started opens a step; thinking, the iteration’s tool calls, their observations, and the final assistant message attach to it).
classify_runtime_error
Classify a runtime/provider error string as infrastructure vs. subject.
target_to_resolved
Map a Mira Target onto an everruns ResolvedModel. A convenience for factory authors; reads the provider’s API key from the conventional env var. Unknown providers default to DriverId::LlmSim (offline).

Type Aliases§

RuntimeFactory
Builds a fresh runtime for a given matrix case. The embedder owns platform/capability/tool/driver wiring here — Mira stays agnostic to it.
RuntimeHandle
A built runtime plus the session to drive for one matrix case.