Combine retrieved chunks into a context block with source citations.
The full prompt is available without an account.
Implement format_context(chunks) where each chunk is a dict {"text": str, "source_id": str}.
- Return a single formatted string.
- Label each chunk with a citation marker like [1], [2], etc. in order of appearance.
- Place the citation marker immediately before the chunk's text.
- Separate chunks with a double newline (\n\n).
- The source_id itself should not appear in the final output — only the citation number.
Read-only Python 3.12 preview. Sign in to edit and execute it.
def format_context(chunks):
# TODO: format chunks with citations
return ""