Command Palette

Search for a command to run...

Hectal
Phase 13: Interviews and Capstone
RAG and Vector Search · Exercise 5 of 5 Previous
Advanced

Daily alerts for the first week

Write alerts(day, baseline_cost) where day is a dict with keys questions, refused, thumbs_down, p95 and dollars, and baseline_cost is the cost per question of day one.

Return a list of strings in this order, including only those that apply: "refusals" when refused / questions > 0.15, "thumbs down" when thumbs_down / questions > 0.10, "latency" when p95 > 6.0, "cost" when dollars / questions > 2 * baseline_cost.

What Check tests

  1. A normal day has no alerts
  2. A refusal spike
  3. A thumbs-down spike
  4. A slow day
  5. A cost jump
  6. Several alerts keep the stated order

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.