Advanced Options from the Add Test dialog in the test suite view.

Conditional Checks
Sometimes, you want to run a check only if a condition is true. For example, let’s say that if your LLM makes reference to Law X, you always want it to also mention Addendum Y. However, if Law X is not mentioned, there is no need to check for Addendum Y. This can be accomplished with what we call a conditional check. If the conditional check passes, your test is run as normal. However, if the predicate check fails, the test passes. To accomplish the example above with a conditional check, you would define your check as includes | Addendum Y as normal. However, you would also add an additional predicate check: includes | Law X. For those interested in boolean logic, the truth table is as follows:| Conditional | Base Check | Test Pass |
|---|---|---|
| Pass | Pass | Pass |
| Pass | Fail | Fail |
| Fail | Pass | Pass |
| Fail | Fail | Pass |
In-Context Examples
Similar to prompt engineering, it can be helpful to provide additional examples of outputs that should fail or pass the check. You can do this with our In-Context Examples feature. From the Advanced Options in the Checks container, selectPositive or Negative to provide the appropriate example.