mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-23 23:29:21 +00:00
core[minor]: Add default implementations to amax_marginal_relevance_search_by_vector and adelete (#19269)
This commit is contained in:
parent
999365186b
commit
29c58528c7
@ -112,8 +112,7 @@ class VectorStore(ABC):
|
|||||||
Optional[bool]: True if deletion is successful,
|
Optional[bool]: True if deletion is successful,
|
||||||
False otherwise, None if not implemented.
|
False otherwise, None if not implemented.
|
||||||
"""
|
"""
|
||||||
|
return await run_in_executor(None, self.delete, ids, **kwargs)
|
||||||
raise NotImplementedError("delete method must be implemented by subclass.")
|
|
||||||
|
|
||||||
async def aadd_texts(
|
async def aadd_texts(
|
||||||
self,
|
self,
|
||||||
@ -513,7 +512,15 @@ class VectorStore(ABC):
|
|||||||
**kwargs: Any,
|
**kwargs: Any,
|
||||||
) -> List[Document]:
|
) -> List[Document]:
|
||||||
"""Return docs selected using the maximal marginal relevance."""
|
"""Return docs selected using the maximal marginal relevance."""
|
||||||
raise NotImplementedError
|
return await run_in_executor(
|
||||||
|
None,
|
||||||
|
self.max_marginal_relevance_search_by_vector,
|
||||||
|
embedding,
|
||||||
|
k=k,
|
||||||
|
fetch_k=fetch_k,
|
||||||
|
lambda_mult=lambda_mult,
|
||||||
|
**kwargs,
|
||||||
|
)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def from_documents(
|
def from_documents(
|
||||||
|
Loading…
Reference in New Issue
Block a user