LLM Engineering · Exercise 5 of 5 Previous
Advanced
Run a red-team suite
Write run_suite(app, cases). app is a function from a message to a reply. Each case is a tuple (name, message, forbidden).
Return the list of case names, in order, whose reply contains the forbidden text, ignoring upper and lower case. Return an empty list when every case passes. An empty forbidden text means the case cannot fail.
What Check tests
- A failing case is reported
- A passing suite returns an empty list
- The comparison ignores case
- Names come back in order
- An empty forbidden text cannot fail
Stuck? One hint at a time
The solution unlocks after your first Check. Try first: that is where the learning happens.
main.py
Sign in to run your code.
Output
Press Run to see what your program prints.