From 6dd757a6745b6ad033be0ba3b26a74d5c69d2644 Mon Sep 17 00:00:00 2001 From: pcbeingused333 <82875882+pcbeingused333@users.noreply.github.com> Date: Tue, 28 Jul 2026 01:56:51 +0000 Subject: [PATCH] fix: [#285] correct RAG optional-dependency install instructions (cofone -> fenn[rag-*]) --- fenn/agents/rag/loader.py | 12 ++++++------ fenn/agents/rag/rag.py | 2 +- fenn/agents/rag/retriever.py | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/fenn/agents/rag/loader.py b/fenn/agents/rag/loader.py index 80be630..4c077c7 100644 --- a/fenn/agents/rag/loader.py +++ b/fenn/agents/rag/loader.py @@ -104,7 +104,7 @@ def _read_file(path): def _read_pdf(path): """ Extract text from a PDF file using pypdf. - Requires: pip install "cofone[pdf]" or pip install pypdf + Requires: pip install "fenn[rag-pdf]" or pip install pypdf """ try: import pypdf @@ -120,7 +120,7 @@ def _read_pdf(path): except ImportError: raise ImportError( "[cofone] pypdf not installed.\n" - 'Run: pip install "cofone[pdf]" or pip install pypdf' + 'Run: pip install "fenn[rag-pdf]" or pip install pypdf' ) @@ -171,7 +171,7 @@ def _load_wikipedia(url): """ Fetch a Wikipedia article's full text using the wikipedia package. Automatically detects language from the URL subdomain. - Requires: pip install "cofone[web]" or pip install wikipedia + Requires: pip install "fenn[rag-web]" or pip install wikipedia """ try: import re @@ -198,7 +198,7 @@ def _load_wikipedia(url): except ImportError: raise ImportError( "[cofone] wikipedia package not installed.\n" - 'Run: pip install "cofone[web]" or pip install wikipedia' + 'Run: pip install "fenn[rag-web]" or pip install wikipedia' ) except Exception as e: raise ValueError(f"[cofone] Wikipedia error for '{url}': {e}") from e @@ -209,7 +209,7 @@ def _load_youtube(url): Fetch a YouTube video's transcript/subtitles. Language priority: English first, then Italian, then any available. Auto-generated captions are supported. - Requires: pip install "cofone[web]" or pip install youtube-transcript-api + Requires: pip install "fenn[rag-web]" or pip install youtube-transcript-api Supports youtube-transcript-api >= 0.6.0 and >= 0.7.0 (dual fallback). """ try: @@ -251,5 +251,5 @@ def _load_youtube(url): except ImportError: raise ImportError( "[cofone] youtube-transcript-api not installed.\n" - 'Run: pip install "cofone[web]" or pip install youtube-transcript-api' + 'Run: pip install "fenn[rag-web]" or pip install youtube-transcript-api' ) diff --git a/fenn/agents/rag/rag.py b/fenn/agents/rag/rag.py index 8025a7e..60ff1d5 100644 --- a/fenn/agents/rag/rag.py +++ b/fenn/agents/rag/rag.py @@ -42,7 +42,7 @@ class RAG: faiss : bool, optional If True, uses FAISS semantic vector search instead of BM25 keyword - search. Requires `pip install "cofone[faiss]"`. Default: False. + search. Requires `pip install "fenn[rag-faiss]"`. Default: False. embedding_provider : str, optional Provider for text embeddings (used only when faiss=True). diff --git a/fenn/agents/rag/retriever.py b/fenn/agents/rag/retriever.py index 6cc61b6..133b2a7 100644 --- a/fenn/agents/rag/retriever.py +++ b/fenn/agents/rag/retriever.py @@ -135,7 +135,7 @@ def _embed_local(self, texts): except ImportError: raise ImportError( "[cofone] sentence-transformers not installed.\n" - 'Run: pip install "cofone[faiss]" or pip install sentence-transformers' + 'Run: pip install "fenn[rag-faiss]" or pip install sentence-transformers' ) def _embed_openai_compat(self, texts): @@ -279,7 +279,7 @@ def _get_faiss(self): if sys.modules.get("faiss") is None: raise ImportError( - '[cofone] faiss-cpu not installed.\nRun: pip install "cofone[faiss]"' + '[cofone] faiss-cpu not installed.\nRun: pip install "fenn[rag-faiss]"' ) mod = sys.modules[__name__] faiss_mod = getattr(mod, "faiss", None) @@ -290,7 +290,7 @@ def _get_faiss(self): setattr(mod, "faiss", faiss_mod) except ImportError: raise ImportError( - '[cofone] faiss-cpu not installed.\nRun: pip install "cofone[faiss]"' + '[cofone] faiss-cpu not installed.\nRun: pip install "fenn[rag-faiss]"' ) return faiss_mod