Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,15 @@ def similarity_search_by_vector_with_score(
document_class=Document,
include_score=self._include_score,
)

async def asimilarity_search_by_vector_with_score(
self, embedding: List[float], k: int = 4, **kwargs: Any
) -> List[Tuple[Document, float]]:
# This is a temporary workaround to make the similarity search
# asynchronous. The proper solution is to make the similarity search
# asynchronous in the vector store implementations.
func = partial(self.similarity_search_by_vector_with_score, embedding, k=k, **kwargs)
return await asyncio.get_event_loop().run_in_executor(None, func)

def max_marginal_relevance_search(
self,
Expand Down