import { EvalScorer, EvalScorerContext } from "../contracts/agent/eval.type.mjs"; //#region ../ai/src/eval/scorers.d.ts /** * Predicate signature for {@link predicate}. Receives the same context * a full scorer does and returns a boolean (sync or async). A `true` * verdict scores `1`, `false` scores `0`. */ type EvalPredicate = (context: EvalScorerContext) => boolean | Promise; /** * Exact-match scorer. Compares the agent's output against the case's * `expected` reference. Prefers `result.data` (parsed structured * output) when present, falling back to `result.text`. Comparison is * trimmed and case-insensitive; structured values are compared by * canonical JSON. * * Scores `1` / `passed: true` on a match, `0` / `passed: false` * otherwise. A case with no `expected` always scores `0` — exact * matching is meaningless without a reference. * * @example * const report = await agent.eval({ * cases: [{ name: "q", input: "2+2?", expected: "4" }], * scorers: [exact()], * }); */ declare function exact(): EvalScorer; /** * Substring / contains scorer. Passes when the normalized `expected` * string appears anywhere in the agent's normalized output. Useful * when the agent's phrasing varies but a key fact must be present. * * @example * scorers: [contains()] // expected "Cairo" passes "The capital is Cairo." */ declare function contains(): EvalScorer; /** * Predicate scorer. Wraps a boolean-returning callback into a scorer — * `true` scores `1` / `passed`, `false` scores `0` / fails. The * escape hatch for arbitrary assertions ("output is valid JSON", "no * tool errored", "duration under budget") that don't fit exact or * judge scoring. * * @example * scorers: [predicate((ctx) => ctx.result.report.children.every(c => c.status === "completed"))] */ declare function predicate(fn: EvalPredicate): EvalScorer; //#endregion export { EvalPredicate, contains, exact, predicate }; //# sourceMappingURL=scorers.d.mts.map