diff --git a/src/backend/langflow/schema.py b/src/backend/langflow/schema.py index de1be7767..053caf3a3 100644 --- a/src/backend/langflow/schema.py +++ b/src/backend/langflow/schema.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import Any, Optional from langchain_core.documents import Document from pydantic import BaseModel @@ -38,6 +38,24 @@ class Record(BaseModel): """ return Document(page_content=self.text, metadata=self.data) + def __call__(self, *args: Any, **kwds: Any) -> Any: + """ + Returns the text of the record. + + Returns: + Any: The text of the record. + """ + return self.text + + def __str__(self) -> str: + """ + Returns the text of the record. + + Returns: + str: The text of the record. + """ + return self.text + def docs_to_records(documents: list[Document]) -> list[Record]: """