Skip to content

Commit

Permalink
fix for loading routes in pinecone
Browse files Browse the repository at this point in the history
  • Loading branch information
jamescalam committed Feb 18, 2024
1 parent ce5d3ee commit 4e8e726
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion semantic_router/index/pinecone.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4e8e726

Please sign in to comment.