await self.initialize()
            return await self.asimilarity_search_with_relevance_scores(
                query, k, **kwargs
            )
        return asyncio.run(_similarity_search_with_relevance_scores())
[docs]    async def asimilarity_search_with_score(
        self, query: str, k: int = 4, **kwargs: Any
    ) -> List[Tuple[Document, float]]:
        """Run similarity search asynchronously and return distance scores
        Args:
            query (str): Query
            k (int): Number of results to return. Defaults to 4.
        Returns:
            List of Documents most similar along with relevance distance scores
        """
        query_embedding = self.embedding_function.embed_query(query)
        return [
            (document, similarity)
            for document, similarity in (
                await self._asimilarity_search_by_vector_with_score(
                    query_embedding, k, **kwargs
                )
            )
        ]
[docs]    def similarity_search_with_score(
        self, query: str, k: int = 4, **kwargs: Any
    ) -> List[Tuple[Document, float]]:
        """Run similarity search synchronously and return distance scores
        Args:
            query (str): Query
            k (int): Number of results to return. Defaults to 4.
        Returns:
            List of Documents most similar along with relevance distance scores
        """
        async def _similarity_search_with_score() -> List[Tuple[Document, float]]:
            await self.initialize()
            return await self.asimilarity_search_with_score(query, k, **kwargs)
        return asyncio.run(_similarity_search_with_score())
[docs]    async def asimilarity_search_by_vector(