Skip to main content
VevalTestSdk is a test double for IVevalSdk. It replays a recorded trace so your agent code runs with mocked LLM responses: deterministic, fast, and free. Unlike calling VevalSdk directly with a trace, VevalTestSdk guarantees no live LLM fallthrough. If a step name doesn’t match the recorded trace, it throws immediately.

Setup

VevalTestSdk still reports traces and scenario results to the dashboard, so runs count in your history.

In a test project

Strict mock mode

If your agent calls TrackStepAsync with a step name that isn’t in the recorded trace, VevalTestSdk throws:
This catches regressions where code changes add new LLM calls that weren’t in the original trace. The opposite fails too: if the agent never calls a step the trace recorded, the replay fails with
When several recorded steps share a name, each call is served the one with an identical input, falling back to the next unused one in recorded order. See how calls are matched. A call whose input differs from every recording of that step is reported, not failed. Read the report from the replay result:

Live replay

To test a prompt change against a recorded trace, replay live: steps recorded as llm call the model, and every other step returns its recorded output, so tools never reach a real system. See Live replay for the rules.
Trace-backed scenario items run with VevalSdk replay live by default; VevalTestSdk keeps them mocked.

Skip side effects

Only code inside a step is served from the recording. Work your agent does outside a step runs again on every replay, so check IsReplay before it. IsReplay is true in every replay, mocked or live, and false in a normal run.
If the side effect’s result matters to the agent, wrap it in a step with SetMeta("type", "tool") instead: replay then returns the recorded result without running it.

ReplayAsync directly

For lower-level control, use ReplayAsync with explicit assertions:

LastStatus / LastError

After RunAsync, inspect the outcome without catching exceptions:

What’s next

Catch regressions with snapshots

Fail a replay when prompts or steps change.

Write assertions

Check cost, steps, outputs, and tool calls.