[docs]    async def asimilarity_search_by_vector(
        self, embedding: List[float], k: int = 4, **kwargs: Any
    ) -> List[Document]:
        """Run similarity search on query embedding asynchronously
        Args:
            embedding (List[float]): Query embedding
            k (int): Number of results to return. Defaults to 4.
        Returns:
            List of Documents most similar to the query
        """
        return [
            document
            for document, _ in await self._asimilarity_search_by_vector_with_score(
                embedding, k, **kwargs
            )
        ]
[docs]    def similarity_search_by_vector(
        self, embedding: List[float], k: int = 4, **kwargs: Any
    ) -> List[Document]:
        """Run similarity search on query embedding
        Args:
            embedding (List[float]): Query embedding
            k (int): Number of results to return. Defaults to 4.
        Returns:
            List of Documents most similar to the query
        """
        async def _similarity_search_by_vector() -> List[Document]:
            await self.initialize()
            return await self.asimilarity_search_by_vector(embedding, k, **kwargs)
        return asyncio.run(_similarity_search_by_vector())
[docs]    async def asimilarity_search(
        self, query: str, k: int = 4, **kwargs: Any
    ) -> List[Document]:
        """Run similarity search on query asynchronously
        Args:
            query (str): Query
            k (int): Number of results to return. Defaults to 4.
        Returns:
            List of Documents most similar to the query
        """
        query_embedding = self.embedding_function.embed_query(query)