mirror of https://github.com/arc53/DocsGPT
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
9 lines
308 B
Python
9 lines
308 B
Python
9 months ago
|
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
|