File size: 308 Bytes
8a41f4d
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
class Document(str):
    """Class for storing a piece of text and associated metadata."""

    def __new__(cls, page_content: str, metadata: dict):
        instance = super().__new__(cls, page_content)
        instance.page_content = page_content
        instance.metadata = metadata
        return instance