From 614cff89bc99dcb2c995a0ec0c375c9ae8941d66 Mon Sep 17 00:00:00 2001 From: Zander Chase <130414180+vowelparrot@users.noreply.github.com> Date: Sun, 11 Jun 2023 15:45:12 -0700 Subject: [PATCH] I before E (#6015) --- langchain/retrievers/milvus.py | 12 +++++++++++- langchain/retrievers/zilliz.py | 12 +++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) 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)