refactor: Update data.py to use a copy of the data dictionary in the to_lc_message method
This commit is contained in:
parent
7704c2e302
commit
7e92f74f28
1 changed files with 3 additions and 2 deletions
|
|
@ -106,8 +106,9 @@ class Data(BaseModel):
|
|||
Returns:
|
||||
Document: The converted Document.
|
||||
"""
|
||||
text = self.data.pop(self.text_key, self.default_value)
|
||||
return Document(page_content=text, metadata=self.data)
|
||||
data_copy = self.data.copy()
|
||||
text = data_copy.pop(self.text_key, self.default_value)
|
||||
return Document(page_content=text, metadata=data_copy)
|
||||
|
||||
def to_lc_message(
|
||||
self,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue