From 80bcc4a3d5c12797a3709c1d05bc2cd6a46dcb36 Mon Sep 17 00:00:00 2001 From: James Briggs Date: Thu, 9 May 2024 20:58:12 +0800 Subject: [PATCH] fix: add namespace to get all for pinecone --- semantic_router/index/pinecone.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/semantic_router/index/pinecone.py b/semantic_router/index/pinecone.py index 31fbfac8..b21f811b 100644 --- a/semantic_router/index/pinecone.py +++ b/semantic_router/index/pinecone.py @@ -188,6 +188,8 @@ def _get_all(self, prefix: Optional[str] = None, include_metadata: bool = False) # Construct the request URL for listing vectors. Adjust parameters as needed. list_url = f"https://{self.host}/vectors/list{prefix_str}" params: Dict = {} + if self.namespace: + params["namespace"] = self.namespace headers = {"Api-Key": os.environ["PINECONE_API_KEY"]} metadata = []