Generation with citations
Write the prompt that turns retrieved passages into an answer: answer only from them, cite each one, and say when they do not cover the question. Then rerun the ten questions from Module 1, and compare.
Colab opens a fresh copy each time. Save your own with File, then Save a copy in Drive.
What you do in this module¶
- Send retrieved passages to Gemini with a naive prompt, and see what goes wrong.
- Number the sources and show each one's version and status.
- Add the rules, and check every citation against its source.
- Ask a question no document covers, and a species trap.
- Rerun the ten questions from Module 1.
The notebook makes about 20 Gemini requests, which fits the free tier. If you hit the limit, the notebook says how long to wait.
Compare with Module 1¶
Before you rerun the ten questions, open your notes from Module 1. If you filled in the sheet in this browser, it is still on the Module 1 page. If you downloaded a copy, open that file. For each question you marked, decide whether the assistant fixed it, did not fix it, or made it worse.
Before you start: what should the assistant say when the documents do not cover a question?
One plain sentence that says so, and nothing more. An exact sentence is easy to spot, for a person and for a program. The notebook tests whether the model sticks to it.
Where next
Building a RAG system: Module 5: Evaluation (coming soon)
A shared question channel is on the way. When it opens, each answer will be written once and shared with everyone taking the course.