Beginner
Build a prompt with sources
Write build_prompt(question, hits) where hits is a list of (doc_id, title, text) tuples.
Return one string with these lines, joined by \n: first Answer using only the sources. Cite the source id in square brackets., then one line per hit [<doc_id>] <title>: <text> in the given order, then Question: <question>.
What Check tests
- One source gives three lines
- Sources keep their order
- The question is the last line
- No sources still gives a valid prompt
Stuck? One hint at a time
The solution unlocks after your first Check. Try first: that is where the learning happens.
main.py
Sign in to run your code.
Output
Press Run to see what your program prints.