""".format(**args)
        results = await self.sdb.query(query)
        if len(results) == 0:
            return []
        return [
            (
                Document(page_content=result["text"], metadata={"id": result["id"]}),
                result["similarity"],
            )
            for result in results[0]["result"]
        ]
[docs]    async def asimilarity_search_with_relevance_scores(
        self, query: str, k: int = 4, **kwargs: Any
    ) -> List[Tuple[Document, float]]:
        """Run similarity search asynchronously and return relevance scores
        Args:
            query (str): Query
            k (int): Number of results to return. Defaults to 4.
        Returns:
            List of Documents most similar along with relevance 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_relevance_scores(
        self, query: str, k: int = 4, **kwargs: Any
    ) -> List[Tuple[Document, float]]:
        """Run similarity search synchronously and return relevance scores
        Args:
            query (str): Query
            k (int): Number of results to return. Defaults to 4.
        Returns:
            List of Documents most similar along with relevance scores
        """
        async def _similarity_search_with_relevance_scores() -> (
            List[Tuple[Document, float]]
        ):
            await self.initialize()
            return await self.asimilarity_search_with_relevance_scores(