mirror of
https://github.com/arc53/DocsGPT
synced 2024-11-17 21:26:26 +00:00
9 lines
308 B
Python
9 lines
308 B
Python
|
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
|