Refactor SplitTextComponent to store parent and text data in Record object (#1998)

refactor: Update SplitTextComponent to store parent and text data in Record object
This commit is contained in:
Gabriel Luiz Freitas Almeida 2024-05-28 12:41:32 -07:00 committed by GitHub
commit 0c32bbe182
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -43,7 +43,7 @@ class SplitTextComponent(CustomComponent):
chunks = [chunk[:truncate_size] for chunk in chunks]
for chunk in chunks:
outputs.append(Record(text=chunk, data={"parent": text}))
outputs.append(Record(data={"parent": text, "text": chunk}))
self.status = outputs
return outputs