Select useful, diverse retrieved evidence for grounded agent answers.
The full prompt is available without an account.
Implement rerank(query, candidates, reranker, top_n).
- candidates is a list of {"id", "text"}.
- reranker(query, text) -> float returns a relevance score.
- Return the top_n candidates sorted by score descending.
Read-only Python 3.12 preview. Sign in to edit and execute it.
def rerank(query, candidates, reranker, top_n):
# TODO: score and return top_n
return []