mirror of
https://github.com/morluto/rea
synced 2026-10-26 14:25:49 -04:00
19 lines
592 B
JavaScript
19 lines
592 B
JavaScript
import { tsImport } from "tsx/esm/api";
|
|
|
|
const { agentEvaluationPassed } = await tsImport(
|
|
new URL(
|
|
"../../tests/evaluation/model-evals/AgentEvaluationReport.ts",
|
|
import.meta.url,
|
|
).href,
|
|
import.meta.url,
|
|
);
|
|
|
|
/** Fail the runner after publishing a report with any rejected scenario. */
|
|
export const assertAgentEvaluationReportPassed = (results) => {
|
|
const failed = results.filter((result) => !agentEvaluationPassed(result));
|
|
if (failed.length > 0)
|
|
throw new Error(
|
|
`Agent routing/workflow/answer checks failed: ${failed.map(({ id }) => id).join(", ")}`,
|
|
);
|
|
};
|