diff --git a/gomate/applications/rag.py b/gomate/applications/rag.py index 404f40f..99dd5e5 100644 --- a/gomate/applications/rag.py +++ b/gomate/applications/rag.py @@ -53,6 +53,7 @@ def add_document(self, file_path): def chat(self, question: str = '', top_k: int = 5): contents = self.retriever.retrieve(query=question, top_k=top_k) + contents=self.reranker.rerank(query=question,documents=[content['text'] for content in contents]) content = '\n'.join([content['text'] for content in contents]) print(contents) response, history = self.llm.chat(question, [], content)