Cross-encoder re-ranking

Hi. I have a very basic question, after getting the results of the reranked documents, how would I put them instead of the old order into the question and answering system from lab 1? instead of output = rag(query=query, retrieved_documents=retrieved_documents) would I do it like output = rag(query=query, retrieved_documents=pairs)?