mirror of
https://github.com/hwchase17/langchain
synced 2024-11-18 09:25:54 +00:00
I before E (#6015)
This commit is contained in:
parent
a7227ee01b
commit
614cff89bc
@ -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)
|
||||||
|
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user