Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jamescalam committed Apr 27, 2024
1 parent ceb67ce commit b6c2aeb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 2 additions & 2 deletions semantic_router/index/pinecone.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def _init_index(self, force_create: bool = False) -> Union[Any, None]:
time.sleep(0.5)
elif index_exists:
# if the index exists we just return it
index = self.client.Index(self.index_name, namespace=self.namespace)
index = self.client.Index(self.index_name)
# grab the dimensions from the index
self.dimensions = index.describe_index_stats()["dimension"]
elif force_create and not dimensions_given:
Expand Down Expand Up @@ -234,7 +234,7 @@ def get_routes(self) -> List[Tuple]:
def delete(self, route_name: str):
route_vec_ids = self._get_route_ids(route_name=route_name)
if self.index is not None:
self.index.delete(ids=route_vec_ids)
self.index.delete(ids=route_vec_ids, namespace=self.namespace)
else:
raise ValueError("Index is None, could not delete.")

Expand Down
2 changes: 0 additions & 2 deletions tests/unit/test_layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,9 +281,7 @@ def test_query_filter_pinecone(self, openai_encoder, routes, index_cls):
encoder=openai_encoder, routes=routes, index=pineconeindex
)
time.sleep(5) # allow for index to be populated
print(routes)
query_result = route_layer(text="Hello", route_filter=["Route 1"]).name
print(query_result)

try:
route_layer(text="Hello", route_filter=["Route 8"]).name
Expand Down

0 comments on commit b6c2aeb

Please sign in to comment.