def _element_document(self, element: Dict) -> Document:
        """
        Converts an elements into a Document object.

        Args:
            element (Dict): The element to be converted into a Document object.

        Returns:
            Document: A Document object representing the element with its content
                      and metadata.

        """
        extra_info = {
            "page": element["page"],
            "id": element["id"],
            "output_format": self.output_format,
            "split": self.split,
            "category": element.get("category"),
        }
        if element.get("coordinates") is not None:
            extra_info["coordinates"] = element.get("coordinates")
        if element.get("base64_encoding") is not None:
            extra_info["base64_encoding"] = element.get("base64_encoding")

        return Document(
            text=(parse_output(element, self.output_format)), extra_info=extra_info
        )

        Converts an elements into a Document object.

        Args:
            element (Dict): The element to be converted into a Document object.

        Returns:
            Document: A Document object representing the element with its content
                      and metadata.

        
llama-index-integrations/readers/llama-index-readers-upstage/llama_index/readers/upstage/document_parse.py