Set what an eval checks

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

  1. In your eval's file, replace metrics with these three and add repetitions:
    evals/divide.eval.ts
    import { 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,})
  2. Run it:
    Shell
    npm run eval -- divide
  3. 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 calls and Latency stayed under 20000ms.

Try it in a sandbox

  1. Create a project

  2. Set the metrics

  3. Check it

Try it out

Next steps