mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-06 21:43:44 +00:00
elasticsearch[patch], community[patch]: update references, deprecate community classes (#18506)
Follow up on https://github.com/langchain-ai/langchain/pull/17467. - Update all references to the Elasticsearch classes to use the partners package. - Deprecate community classes. --------- Co-authored-by: Bagatur <baskaryan@gmail.com>
This commit is contained in:
@@ -15,6 +15,7 @@ from typing import (
|
||||
)
|
||||
|
||||
import numpy as np
|
||||
from langchain_core._api import deprecated
|
||||
from langchain_core.documents import Document
|
||||
from langchain_core.embeddings import Embeddings
|
||||
from langchain_core.vectorstores import VectorStore
|
||||
@@ -113,6 +114,9 @@ class BaseRetrievalStrategy(ABC):
|
||||
return True
|
||||
|
||||
|
||||
@deprecated(
|
||||
"0.0.27", alternative="Use class in langchain-elasticsearch package", pending=True
|
||||
)
|
||||
class ApproxRetrievalStrategy(BaseRetrievalStrategy):
|
||||
"""Approximate retrieval strategy using the `HNSW` algorithm."""
|
||||
|
||||
@@ -233,6 +237,9 @@ class ApproxRetrievalStrategy(BaseRetrievalStrategy):
|
||||
}
|
||||
|
||||
|
||||
@deprecated(
|
||||
"0.0.27", alternative="Use class in langchain-elasticsearch package", pending=True
|
||||
)
|
||||
class ExactRetrievalStrategy(BaseRetrievalStrategy):
|
||||
"""Exact retrieval strategy using the `script_score` query."""
|
||||
|
||||
@@ -300,6 +307,9 @@ class ExactRetrievalStrategy(BaseRetrievalStrategy):
|
||||
}
|
||||
|
||||
|
||||
@deprecated(
|
||||
"0.0.27", alternative="Use class in langchain-elasticsearch package", pending=True
|
||||
)
|
||||
class SparseRetrievalStrategy(BaseRetrievalStrategy):
|
||||
"""Sparse retrieval strategy using the `text_expansion` processor."""
|
||||
|
||||
@@ -381,6 +391,9 @@ class SparseRetrievalStrategy(BaseRetrievalStrategy):
|
||||
return False
|
||||
|
||||
|
||||
@deprecated(
|
||||
"0.0.27", alternative="Use class in langchain-elasticsearch package", pending=True
|
||||
)
|
||||
class ElasticsearchStore(VectorStore):
|
||||
"""`Elasticsearch` vector store.
|
||||
|
||||
|
Reference in New Issue
Block a user