diff --git a/langchain/retrievers/milvus.py b/langchain/retrievers/milvus.py index 915d61d989..58f1bf23cf 100644 --- a/langchain/retrievers/milvus.py +++ b/langchain/retrievers/milvus.py @@ -1,4 +1,5 @@ """Milvus Retriever""" +import warnings from typing import Any, Dict, List, Optional from langchain.embeddings.base import Embeddings @@ -8,7 +9,7 @@ from langchain.vectorstores.milvus import Milvus # TODO: Update to MilvusClient + Hybrid Search when available -class MilvusRetreiver(BaseRetriever): +class MilvusRetriever(BaseRetriever): def __init__( self, embedding_function: Embeddings, @@ -41,3 +42,12 @@ class MilvusRetreiver(BaseRetriever): async def aget_relevant_documents(self, query: str) -> List[Document]: raise NotImplementedError + + +def MilvusRetreiver(*args: Any, **kwargs: Any) -> MilvusRetriever: + warnings.warn( + "MilvusRetreiver will be deprecated in the future. " + "Please use MilvusRetriever ('i' before 'e') instead.", + DeprecationWarning, + ) + return MilvusRetriever(*args, **kwargs) diff --git a/langchain/retrievers/zilliz.py b/langchain/retrievers/zilliz.py index 6b39a3a022..d64a49758e 100644 --- a/langchain/retrievers/zilliz.py +++ b/langchain/retrievers/zilliz.py @@ -1,4 +1,5 @@ """Zilliz Retriever""" +import warnings from typing import Any, Dict, List, Optional from langchain.embeddings.base import Embeddings @@ -8,7 +9,7 @@ from langchain.vectorstores.zilliz import Zilliz # TODO: Update to ZillizClient + Hybrid Search when available -class ZillizRetreiver(BaseRetriever): +class ZillizRetriever(BaseRetriever): def __init__( self, embedding_function: Embeddings, @@ -41,3 +42,12 @@ class ZillizRetreiver(BaseRetriever): async def aget_relevant_documents(self, query: str) -> List[Document]: raise NotImplementedError + + +def ZillizRetreiver(*args: Any, **kwargs: Any) -> ZillizRetriever: + warnings.warn( + "ZillizRetreiver will be deprecated in the future. " + "Please use ZillizRetriever ('i' before 'e') instead.", + DeprecationWarning, + ) + return ZillizRetriever(*args, **kwargs)