An eval's metrics are its checks. Each has a severity: a gate fails the eval, soft only reports, and budget fails it when a case goes over a usage threshold such as time, without stopping the case. Runs per case repeats every test case, to see how steady the answer is.
Before you start
You need an eval. See Write an eval.
Edit the metrics
- In your eval's file, replace
metricswith these three and addrepetitions:evals/divide.eval.tsimport { datasets, evalAgent, metrics } from 'veryfront/eval' export default evalAgent({ name: 'Divide', target: 'agent:assistant', dataset: datasets.inline([{ id: 'divide', input: 'What is 128 divided by 8?' }]), metrics: [ metrics.answer.contains({ text: '16' }).gate(), metrics.agent.noFailedTools().soft(), metrics.ops.latency({ maxMs: 20000 }).budget(), ], repetitions: 3,}) - Run it:
Shell
npm run eval -- divide - Read the result. You should now see
Result: 3/3 passed, with the three metrics under it:Answer contained "16",Agent had no failed tool callsandLatency stayed under 20000ms.
Try it in a sandbox
Create a project
Set the metrics
Check it