I before E (#6015)

This commit is contained in:
Zander Chase 2023-06-11 15:45:12 -07:00 committed by GitHub
parent a7227ee01b
commit 614cff89bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 2 deletions

View File

@ -1,4 +1,5 @@
"""Milvus Retriever""" """Milvus Retriever"""
import warnings
from typing import Any, Dict, List, Optional from typing import Any, Dict, List, Optional
from langchain.embeddings.base import Embeddings from langchain.embeddings.base import Embeddings
@ -8,7 +9,7 @@ from langchain.vectorstores.milvus import Milvus
# TODO: Update to MilvusClient + Hybrid Search when available # TODO: Update to MilvusClient + Hybrid Search when available
class MilvusRetreiver(BaseRetriever): class MilvusRetriever(BaseRetriever):
def __init__( def __init__(
self, self,
embedding_function: Embeddings, embedding_function: Embeddings,
@ -41,3 +42,12 @@ class MilvusRetreiver(BaseRetriever):
async def aget_relevant_documents(self, query: str) -> List[Document]: async def aget_relevant_documents(self, query: str) -> List[Document]:
raise NotImplementedError 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)

View File

@ -1,4 +1,5 @@
"""Zilliz Retriever""" """Zilliz Retriever"""
import warnings
from typing import Any, Dict, List, Optional from typing import Any, Dict, List, Optional
from langchain.embeddings.base import Embeddings from langchain.embeddings.base import Embeddings
@ -8,7 +9,7 @@ from langchain.vectorstores.zilliz import Zilliz
# TODO: Update to ZillizClient + Hybrid Search when available # TODO: Update to ZillizClient + Hybrid Search when available
class ZillizRetreiver(BaseRetriever): class ZillizRetriever(BaseRetriever):
def __init__( def __init__(
self, self,
embedding_function: Embeddings, embedding_function: Embeddings,
@ -41,3 +42,12 @@ class ZillizRetreiver(BaseRetriever):
async def aget_relevant_documents(self, query: str) -> List[Document]: async def aget_relevant_documents(self, query: str) -> List[Document]:
raise NotImplementedError 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)