langchain/document_transformers.py/_DocumentWithState/to_document
class _DocumentWithState:    def to_document(self) -> Document:
        """Convert the DocumentWithState to a Document."""
        return Document(page_content=self.page_content, metadata=self.metadata)