Distinguish Test Errors from Assertion Failures
Example chain that shows how to differentiate between provider errors and failed assertions in LLM testing workflows.
Why it matters
Demonstrate and validate the difference between provider-level errors (system failures) and test-level failures (failed assertions) in LLM evaluation workflows, ensuring proper error handling and test result interpretation.
Outcomes
What it gets done
Trigger intentional provider errors using special prompt markers
Separate system-level failures from assertion-based test failures
Validate error handling behavior in evaluation pipelines
Demonstrate proper test failure classification patterns
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/pfoo-eval-errors-vs-failures | bash Overview
Eval Errors Vs Failures
A promptfoo example that contains a custom provider which throws errors when prompts include `!ERROR!`, demonstrating the distinction between test errors (provider failures) and test failures (failed assertions). Use this example to see how promptfoo distinguishes between test errors and test failures. The custom provider throws errors when prompts contain `!ERROR!`, allowing you to observe the different failure types.
What it does
This promptfoo example demonstrates the distinction between test errors and test failures during evaluation. It contains a custom provider that throws errors when the prompt includes !ERROR!, showing how promptfoo distinguishes between test errors (provider failures) and test failures (failed assertions).
Inputs and outputs
You provide prompts to the custom provider. Test cases that contain the !ERROR! string will trigger error conditions from the provider.
How to use
Initialize and run the example with these commands:
npx promptfoo@latest init --example eval-errors-vs-failures
cd eval-errors-vs-failures
The example contains a custom provider that throws errors when the prompt includes !ERROR!.
Source README
eval-errors-vs-failures (Errors Vs Failures)
You can run this example with:
npx promptfoo@latest init --example eval-errors-vs-failures
cd eval-errors-vs-failures
Usage
This directory contains a custom provider that throws errors when the prompt includes !ERROR!, demonstrating how promptfoo distinguishes between test errors (provider failures) and test failures (failed assertions).
FAQ
Common questions
Discussion
Questions & comments ยท 0
Sign In Sign in to leave a comment.