Test Cases
Create prompts and assertions for regression testing.
Test Cases define the prompts and expected behavior used to check Sagent. They turn important customer journeys and safety requirements into repeatable release checks.
Use test cases to protect behavior that matters to your business. Update them when you intentionally change Sagent’s configuration or capabilities.
Use Test Cases to create and maintain the prompts and assertions used in regression testing.
Choose an assertion type
Use assertions to define how QA grades Sagent's response.
LLM-graded assertions
LLM Rubric — grades the response against a custom rubric. Describe expected behaviour in plain English.
Factuality — compares the response with an expected fact. It checks whether the response agrees, contradicts, or is unrelated.
Closed QA — checks whether the response correctly answers a closed question using the reference answer.
Answer Relevance — scores how relevant the response is to the original prompt. No value is required.
String matching
String matching is fast and has no LLM cost.
Not Contains — checks that the response does not contain an exact, case-sensitive string.
Not Contains (case-insensitive) — checks that the response does not contain a string, regardless of case.
Contains — checks that the response contains an exact, case-sensitive string.
Contains (case-insensitive) — checks that the response contains a string, regardless of case.
Pattern matching
Pattern matching is fast and has no LLM cost.
Not Regex — checks that the response does not match a regular expression. Use it to block patterns such as prices or URLs.
Regex — checks that the response matches a regular expression pattern.
Tool usage
Tool-usage assertions are fast and have no LLM cost.
Used Question Tool — passes when Sagent asks a clarifying question through the question tool. No value is required.
Used Product Search Tool — passes when Sagent returns product results through the product-search tool. No value is required.
Safety
Is Refusal — detects whether a response is a refusal. It supports English only and has no LLM cost. Use an LLM Rubric alongside it for multilingual testing.
Moderation — uses the OpenAI Moderation API to check for harmful, violent, or explicit content. No value is required.
Frequently asked questions
Last updated
Was this helpful?
