L2_Norm = L2_Norm + score * score
        L2_Norm = pow(L2_Norm, 0.5)
        doc_no = 0
        for doc in retrieval_docs:
            doc_tuple = (doc, 1 - scores[doc_no] / L2_Norm)
            results.append(doc_tuple)
            doc_no = doc_no + 1
        return results
[docs]    def similarity_search_by_vector(
        self,
        embedding: Optional[List[float]] = None,
        k: int = DEFAULT_TOPN,
        scores: Optional[list] = None,
        **kwargs: Any,
    ) -> List[Document]:
        """Return docs most similar to embedding vector.
        Args:
            embedding: Embedding to look up documents similar to.
            k: Number of Documents to return. Defaults to 4.
        Returns:
            List of Documents most similar to the query vector.
        """
        if self.awadb_client is None:
            raise ValueError("AwaDB client is None!!!")
        results: List[Document] = []
        if embedding is None:
            return results
        show_results = self.awadb_client.Search(embedding, k)
        if show_results.__len__() == 0:
            return results
        for item_detail in show_results[0]["ResultItems"]:
            content = ""
            meta_data = {}
            for item_key in item_detail:
                if (
                    item_key == "Field@0" and self.embedding_model is not None
                ):  # text for the document
                    content = item_detail[item_key]
                elif self.embedding_model is None and item_key == "embedding_text":
                    content = item_detail[item_key]
rtdocs_stable/api.python.langchain.com/en/stable/_modules/langchain/vectorstores/awadb.html