Skip to content

Commit

Permalink
all PR Check Passed
Browse files Browse the repository at this point in the history
  • Loading branch information
ericljx2020-gmail committed Sep 19, 2024
1 parent 6e88cab commit 3fc4ec7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions semantic_router/index/milvus.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import numpy as np
from semantic_router.schema import Metric
from pydantic.v1 import Field, BaseModel
from pydantic.v1 import Field
from semantic_router.utils.logger import logger


Expand Down Expand Up @@ -179,7 +179,6 @@ def delete(self, route_name: str):

def describe(self):
"""Describe the index with statistics."""
info = self.client.describe_collection(collection_name=self.index_name)
stats = self.client.get_collection_stats(collection_name=self.index_name)
params = {
"vectors": stats["row_count"],
Expand All @@ -205,7 +204,7 @@ def query(
if not self.client.has_collection(collection_name=self.index_name):
raise ValueError("Index not found.")

vector = [vector.tolist()]
vector = vector.reshape(1, -1)

if route_filter:
filter_rule = f"route in {str(route_filter)}"
Expand Down Expand Up @@ -242,6 +241,7 @@ async def aquery(
"""Async query is not implemented for MilvusIndex."""
if self.sync is not None:
logger.error("Async query is not implemented for Milvus.")
return self.query(vector, top_k, route_filter)

def aget_routes(self):
"""Async get_routes is not implemented for MilvusIndex."""
Expand Down

0 comments on commit 3fc4ec7

Please sign in to comment.