refactor: use llama hub instead of llama index (#592)

This commit is contained in:
cachho
2023-09-12 05:56:58 +02:00
committed by GitHub
parent 1864f4cb38
commit dfe0b414ac
2 changed files with 3 additions and 5 deletions

View File

@@ -2,7 +2,7 @@ import logging
import os
try:
from llama_index import download_loader
from llama_hub.notion.base import NotionPageReader
except ImportError:
raise ImportError(
"Notion requires extra dependencies. Install with `pip install --upgrade embedchain[community]`"
@@ -19,8 +19,6 @@ class NotionLoader(BaseLoader):
def load_data(self, source):
"""Load data from a PDF file."""
NotionPageReader = download_loader("NotionPageReader")
# Reformat Id to match notion expectation
id = source[-32:]
formatted_id = f"{id[:8]}-{id[8:12]}-{id[12:16]}-{id[16:20]}-{id[20:]}"