| name | vally-eval |
| description | Author, validate, and run Vally evaluation suites for agent skills. TRIGGERS: create eval, write eval, add eval, run eval, validate eval, vally eval, eval.yaml, add stimulus, map test to eval, migrate test to eval, eval graders, eval scoring, add eval to CI. |
| license | MIT |
| metadata | {"author":"Microsoft","version":"1.0.0"} |
Vally eval suites
Skills in the azure-skills plugin are required to have integration tests that run prompts against an LLM agent to evaluate whether they help the agent accomplish goals in target scenarios. Such integration tests are written as vally eval suites, using vally as the underlying tool for running tests and grading the agent outcome.
Write vally eval suites
Vally eval suites are written as yaml documents. All eval suites share eval spec.
Refer to the official documentation on the schema of the spec and the schema of the eval suites writing-eval-specs.
Vally eval suites for azure-skills plugin have the following file layout. The shared eval spec is located at <repo-root>/.vally.yaml. The eval suites are categorized by plugin and skills. The eval suites for each skill are located at <repo-root>/evals/<plugin-dirname>/<skill-name>/*.yaml, e.g. <repo-root>/evals/azure-skills/azure-ai/eval.yaml.
Use meaningful file names to categorize tests. If a skill needs fixture files for its eval suites, it should organize such fixture files in a fixture directory under its directory, e.g. <repo-root>/evals/azure-skills/azure-ai/fixture/. The vally test runner and stimulus validation script will load all *.yaml files except for those under a fixture/ directory. Make sure to put all fixture files under the fixture/ directory.
Why is there a custom executor
Our custom executor implemented features that vally doesn't support yet, such as early termination, system prompt modification, screenshot taking, etc. Besides, test-all-integration runs automated integration tests, collects its exported data and feeds the data to a dashboard web app under <repo-root>/dashboard/ to monitor skill integration test results.
If you intend to have your vally suites use any of the extended features or have their results be consumed by the dashboard, you MUST use the custom executor in your vally suites.
Use tags to control the custom executor
The custom executor uses special tag values to control the behavior of the custom executor. See tag-helpers.ts to learn what special tags are supported.
Note: If an eval suite specifies an earlyTerminate condition, the suite MUST NOT use the completed grader because early terminated runs will always fail the completed grader by design.
Validate vally eval suites
Vally eval suites in this repo follow certain conventions. For example, all eval suites must have a type, tier, cost and area tag so they can be run for a corresponding target group. To ensure all eval suites follow the conventions, a script is added to validate the eval suites and report errors when it sees any violation. To run the script, execute this command from the scripts/ directory.
npm run vally validate-stimulus
Extended features such as early termination are implemented using tags and many of them use serialized JSON objects as input. This validation script also validates the values of these special tags.
Run vally eval suites locally
Use vally-cli to run vally eval suites. In most cases, you would like to use a command like this.
npm run test:vally -- --plugin $PLUGIN_DIR --skill $SKILL
See vally test runner on how it composes the vally commands under the hood.
Run vally eval suites in CI
Vally eval suites implemented in this repo can be added to the CI test workflow to be run nightly and publish results for reviewing. Refer to ci-test on how to add the Vally eval suites to the CI test workflow.
Extend with custom grader
Custom graders can be added to grade trajectories in ways built-in graders don't support. To add a custom grader, follow the examples in the official vally documentation to create a tests/vally/<custom-name>-grader.ts module and register the new custom grader in tests/vally/vally-graders.ts. The npm run test:vally command internally loads all the custom graders when testing skills.
Re-grade an existing trajectory
Test authors commonly need to fine-tune grader configurations to reduce result flakiness. Vally supports re-grading an existing trajectory using a command like this:
npx @microsoft/vally-cli grade --eval-spec ../evals/<plugin-dirname>/<skill-name>/eval.yaml --verbose < results/<test-run-name>/results.jsonl
You can keep tuning the grader config in eval.yaml and re-grade the trajectory until the results meet your expectations.
If your skill uses a custom grader, add --grader-plugin to load the custom graders.
npx @microsoft/vally-cli grade --eval-spec ../evals/<plugin-dirname>/<skill-name>/eval.yaml --grader-plugin
../../../tests/vally/vally-graders.ts --verbose < results/<test-run-name>/results.jsonl
Note that the grader plugin's path is relative to the parent directory of the eval spec to run. For example, if the eval spec to run is <repo-root>/evals/azure-skills/azure-ai/eval.yaml, resolving this relative path ends at <repo-root>/tests/vally/vally-executor.ts.
Collect test results
When running locally, the test results can be found at the following directories:
tests/reports/<test-run-name>/
tests/results/<test-run-name>/
When running in CI, the test results can be found in the GitHub Action artifacts or at a storage account that the workflow publishes to. You can also use the integration tests dashboard to view the test results from nightly test runs.