Commit a92b028a authored by John Wang's avatar John Wang

feat: remove notion load_as_text func

parent bb22e823
......@@ -239,8 +239,9 @@ class DataSourceNotionApi(Resource):
notion_page_type=page_type
)
text_docs = loader.load()
return {
'content': loader.load_as_text()
'content': "\n".join([doc.page_content for doc in text_docs])
}, 200
@setup_required
......
......@@ -75,11 +75,6 @@ class NotionLoader(BaseLoader):
return text_docs
def load_as_text(self) -> str:
text_docs = self._load_data_as_documents(self._notion_obj_id, self._notion_page_type)
text = "\n".join([doc.page_content for doc in text_docs])
return text
def _load_data_as_documents(
self, notion_obj_id: str, notion_page_type: str
) -> List[Document]:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment