Demonstrates creating a custom assertion type using defineAssertion() from @agentv/eval and convention-based discovery from .agentv/assertions/.
- Defines a
word-countassertion in.agentv/assertions/word-count.ts - Uses it in EVAL.yaml via
type: word-countunderassertions: - The assertion checks that the output has a minimum word count
# From repository root
cd examples/features/sdk-custom-assertion
bun install
# Run the evaluation (uses mock_agent)
agentv eval evals/dataset.eval.yamldefineAssertion()— simplest way to add custom evaluation logic- Convention discovery — files in
.agentv/assertions/are auto-discovered by type name - Pass/fail with reasoning — return
{ pass, reasoning }for clear results