Command Palette

Search for a command to run...

Hectal
Phase 13: Cost, Limits and Production
AI Frontend · Exercise 3 of 6 PreviousNext
Intermediate

Backup Mode and the Kill Switch

The route answers three requests in turn. The 1st is { text, mode: "main" }. The 2nd is { text, mode: "backup" }. From the 3rd on, the kill switch is on: status 503 with { error: "ai_paused" }.

Clicking #ask shows text in #answer. When the mode is backup, #mode must read Backup mode: shorter answers, otherwise it is empty. On the ai_paused 503, #paused must read Mitra is switched off for a short while. and #ask must be disabled.

What Check tests

  1. The 1st answer is shown with no mode label
  2. The 2nd answer shows the backup label
  3. The 3rd request shows the paused message and disables Ask

Stuck? One hint at a time

The solution unlocks after your first Check. Try first: that is where the learning happens.

Runs in your browser. Your code is saved here.

Your page

Press Run to see the page.

Console

Nothing logged yet.