From 3fc4ec72211e4d126239ce97b00033a0f9c167b7 Mon Sep 17 00:00:00 2001 From: Harica404 <68884486+ericljx2020-gmail@users.noreply.github.com> Date: Thu, 19 Sep 2024 16:03:30 +0800 Subject: [PATCH] all PR Check Passed --- semantic_router/index/milvus.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/semantic_router/index/milvus.py b/semantic_router/index/milvus.py index a0c7e17a..3082ecd6 100644 --- a/semantic_router/index/milvus.py +++ b/semantic_router/index/milvus.py @@ -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 @@ -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"], @@ -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)}" @@ -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."""