Advanced
Show the Daily Limit
This Mitra uses useChat. The server allows 2 questions and then answers 429 with a retry-after header of 90. Today the page shows nothing special when that happens.
In the transport's fetch wrapper, notice the 429, read the header, and show Daily limit reached. Try again in 2 minutes. in #error (the wait in whole minutes, rounded up). Also disable #prompt and #send from then on.
What Check tests
- Two questions get answers
- The third question shows the wait in
#error - After the limit, the box and the button are disabled
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.