Skip to content

armgit / mem0

Public Imported from GitHub
0

The Memory Layer for AI Agents - Drop-in memory infrastructure for AI agents and apps. Context that persists. Built for production.

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

cachhodfe0b414ac91
diff --git a/embedchain/loaders/notion.py b/embedchain/loaders/notion.py
index ad6c93a62..a4bf79ff7 100644
--- a/embedchain/loaders/notion.py
+++ b/embedchain/loaders/notion.py
@@ -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:]}"
diff --git a/pyproject.toml b/pyproject.toml
index afa1113a7..373c06401 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -91,7 +91,7 @@ youtube-transcript-api = "^0.6.1"
beautifulsoup4 = "^4.12.2"
pypdf = "^3.11.0"
pytube = "^15.0.0"
-llama-index = { version = "^0.7.21", optional = true }
+llama-hub = { version = "^0.0.29", optional = true }
sentence-transformers = { version = "^2.2.2", optional = true }
torch = { version = ">=2.0.0, !=2.0.1", optional = true }
# Torch 2.0.1 is not compatible with poetry (https://github.com/pytorch/pytorch/issues/100974)
@@ -118,7 +118,7 @@ isort = "^5.12.0"
[tool.poetry.extras]
streamlit = ["streamlit"]
-community = ["llama-index"]
+community = ["llama-hub"]
opensource = ["sentence-transformers", "torch", "gpt4all"]
elasticsearch = ["elasticsearch"]
poe = ["fastapi-poe"]