Command Palette

Search for a command to run...

Hectal
Phase 1: Calling a Model over HTTP
AI Frontend · Exercise 2 of 6 PreviousNext
Beginner

Cut Off, Blocked and Complete

The stand-in model answers three questions in turn: the first answer is cut off at the length limit, the second is blocked by a filter and has no text, the third is complete. Every call is HTTP 200.

Each click on #ask sends the next question. Show the answer in #answer and a note in #note. A cut-off answer shows its text plus … and the note This answer was cut off. A blocked answer shows no text and the note Mitra cannot answer that. A complete answer shows the text and an empty note.

What Check tests

  1. The first answer (cut off) shows its text, then …, and the note This answer was cut off.
  2. The second answer (blocked) leaves #answer empty and the note says Mitra cannot answer that.
  3. The third answer (complete) shows its text and clears the note

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.