import { Agent, openai } from "@agentium/core";
import { EvalSuite, contains, regexMatch, custom, ConsoleReporter } from "@agentium/eval";
const agent = new Agent({
name: "eval-target",
model: openai("gpt-4o-mini"),
instructions: "Be factual and short.",
});
const suite = new EvalSuite({
name: "Basic Quality Suite",
agent,
cases: [
{ name: "Capital of France", input: "What is the capital of France?", expected: "Paris" },
{ name: "Simple math", input: "What is 15 * 7?", expected: "105" },
],
scorers: [
contains("Paris"),
regexMatch(/\d+/),
custom("non-empty", async (_input, output) => {
const pass = output.text.length > 10;
return { score: pass ? 1 : 0, pass, reason: pass ? undefined : "too short" };
}),
],
threshold: 0.5,
concurrency: 2,
});
const result = await suite.run();
new ConsoleReporter().report(result);