refactor: use llama hub instead of llama index (#592)
This commit is contained in:
@@ -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:]}"
|
||||
|
||||
Reference in New Issue
Block a user