From 00d3ec5ed8346e332ce86e9e49f72bb6bb267739 Mon Sep 17 00:00:00 2001 From: Kenneth Leung Date: Mon, 3 Apr 2023 05:04:23 +0800 Subject: [PATCH] Reduce number of documents to return for Pinecone (#2299) Minor change: Currently, Pinecone is returning 5 documents instead of the 4 seen in other vectorstores, and the comments this Pinecone script itself. Adjusted it from 5 to 4. --- langchain/vectorstores/pinecone.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/langchain/vectorstores/pinecone.py b/langchain/vectorstores/pinecone.py index 7983ba45..b5479acf 100644 --- a/langchain/vectorstores/pinecone.py +++ b/langchain/vectorstores/pinecone.py @@ -90,7 +90,7 @@ class Pinecone(VectorStore): def similarity_search_with_score( self, query: str, - k: int = 5, + k: int = 4, filter: Optional[dict] = None, namespace: Optional[str] = None, ) -> List[Tuple[Document, float]]: @@ -125,7 +125,7 @@ class Pinecone(VectorStore): def similarity_search( self, query: str, - k: int = 5, + k: int = 4, filter: Optional[dict] = None, namespace: Optional[str] = None, **kwargs: Any,