diff --git a/private_gpt/components/vector_store/vector_store_component.py b/private_gpt/components/vector_store/vector_store_component.py index 37bef89a..f9932b57 100644 --- a/private_gpt/components/vector_store/vector_store_component.py +++ b/private_gpt/components/vector_store/vector_store_component.py @@ -135,7 +135,6 @@ class VectorStoreComponent: similarity_top_k: int = 2, ) -> VectorIndexRetriever: # This way we support qdrant (using doc_ids) and the rest (using filters) - similarity_top_k = self.settings.rag.similarity_top_k return VectorIndexRetriever( index=index, similarity_top_k=similarity_top_k, diff --git a/private_gpt/server/chat/chat_service.py b/private_gpt/server/chat/chat_service.py index e4e52ead..dcd0514d 100644 --- a/private_gpt/server/chat/chat_service.py +++ b/private_gpt/server/chat/chat_service.py @@ -109,7 +109,7 @@ class ChatService: settings = self.settings if use_context: vector_index_retriever = self.vector_store_component.get_retriever( - index=self.index, context_filter=context_filter + index=self.index, context_filter=context_filter, similarity_top_k=self.settings.rag.similarity_top_k, ) return ContextChatEngine.from_defaults( system_prompt=system_prompt,