Three promises, checked in code
No model runs here. The five answers are examples of what a model might return; the review is plain code.
This course builds one product from start to finish: AskDocs, a service that answers questions from a company handbook, shows its sources and refuses when the handbook has no answer. Each phase adds one production-grade part.
Change the code and press Run (Ctrl+Enter). Predict what will happen first, then break it on purpose and read what changes. Your edits are saved and match the lesson page.
Ready for more? This phase has 5 hands-on exercises with automatic checks.
Practice questions
Write the code in the editor, run it, then open the model answer to compare.
Write has_citation(answer) that returns True when the answer contains at least one [...] with something inside the brackets. Test it on three strings.
Write refusal_rate(answers, refusal) that returns the share of answers equal to the refusal sentence, and print it to two decimals for five sample answers.
Explain it without notes
What does AskDocs do, and what are the six promises it makes?
Why does the course keep the same function names and shapes in every phase?
Which of the promises can be checked with plain code, without a model? Give two examples.
Describe the two paths in a RAG system and when each one runs.
Expected output
The monthly pass costs 25 dollars. [D8]
retrieved: D8, D6 -> ok
Refunds take 5 working days. [D9]
retrieved: D1, D6 -> FAIL: cites D9, which was not retrieved
A helmet is included free with every rental.
retrieved: D4 -> FAIL: no source is cited
Yes, we rent scooters at every shop.
retrieved: nothing -> FAIL: nothing was retrieved, so it had to refuse
I can't find that in the handbook.
retrieved: nothing -> ok