diff --git a/semantic_router/index/pinecone.py b/semantic_router/index/pinecone.py index a6492226..ae210a4f 100644 --- a/semantic_router/index/pinecone.py +++ b/semantic_router/index/pinecone.py @@ -156,10 +156,12 @@ def _get_all(self, prefix: Optional[str] = None, include_metadata: bool = False) # Make the request to list vectors. Adjust headers and parameters as needed. response = requests.get(list_url, params=params, headers=headers) response_data = response.json() - print(response_data) # Extract vector IDs from the response and add them to the list vector_ids = [vec["id"] for vec in response_data.get("vectors", [])] + # check that there are vector IDs, otherwise break the loop + if not vector_ids: + break all_vector_ids.extend(vector_ids) # if we need metadata, we fetch it