def euclidean_distance(
        self, query: str, document: str
    ) -> Union[float, Tuple[float, Dict[str, str]]]:
        """
        Runs L2 distance on the query and document embeddings

        Example:
            Below is just one example. Embedders from LlamaIndex are supported:
            https://docs.llamaindex.ai/en/latest/module_guides/models/embeddings/

            ```python
            from llama_index.embeddings.openai import OpenAIEmbedding
            from trulens.feedback.embeddings import Embeddings

            embed_model = OpenAIEmbedding()

            # Create the feedback function
            f_embed = feedback.Embeddings(embed_model=embed_model)
            f_embed_dist = feedback.Feedback(f_embed.euclidean_distance)\
                .on_input_output()
            ```

        Args:
            query (str): A text prompt to a vector DB.
            document (str): The document returned from the vector DB.

        Returns:
            float: the embedding vector distance
        """

        query_embed = np.asarray(
            self._embed_model.get_query_embedding(query)
        ).reshape(
            1, -1
        )  # sklearn expects 2d array (first dimension number of samples)
        document_embed = np.asarray(
            self._embed_model.get_text_embedding(document)
        ).reshape(
            1, -1
        )  # sklearn expects 2d array (first dimension number of samples)

        # final results will be dimensions (sample query x sample doc) === (1,1)
        return sklearn.metrics.pairwise.euclidean_distances(
            query_embed, document_embed
        )[0][0]

        Runs L2 distance on the query and document embeddings

        Example:
            Below is just one example. Embedders from LlamaIndex are supported:
            https://docs.llamaindex.ai/en/latest/module_guides/models/embeddings/

            ```python
            from llama_index.embeddings.openai import OpenAIEmbedding
            from trulens.feedback.embeddings import Embeddings

            embed_model = OpenAIEmbedding()

            # Create the feedback function
            f_embed = feedback.Embeddings(embed_model=embed_model)
            f_embed_dist = feedback.Feedback(f_embed.euclidean_distance)                .on_input_output()
            ```

        Args:
            query (str): A text prompt to a vector DB.
            document (str): The document returned from the vector DB.

        Returns:
            float: the embedding vector distance
        
src/feedback/trulens/feedback/embeddings.py