diff --git a/ollama/check_env.py b/ollama/check_env.py index 359f0e9..27c674c 100644 --- a/ollama/check_env.py +++ b/ollama/check_env.py @@ -62,7 +62,8 @@ def _parse_ollama_models(raw_output: str) -> list[str]: sys.path.insert(0, str(Path(__file__).parent.parent)) try: - from config import EMBED_MODEL as CONFIGURED_EMBED, OLLAMA_MODEL as CONFIGURED_LLM + from ingestion.config import EMBED_MODEL as CONFIGURED_EMBED + from rag.config import OLLAMA_MODEL as CONFIGURED_LLM except Exception: CONFIGURED_EMBED = None CONFIGURED_LLM = None diff --git a/ollama/test_ollama.py b/ollama/test_ollama.py index 3054d59..0a87160 100644 --- a/ollama/test_ollama.py +++ b/ollama/test_ollama.py @@ -11,7 +11,7 @@ import urllib.request from pathlib import Path sys.path.insert(0, str(Path(__file__).parent.parent)) -import config as _cfg +from rag import config as _cfg OLLAMA_URL = _cfg.OLLAMA_URL MODEL = _cfg.OLLAMA_MODEL diff --git a/rag/__init__.py b/rag/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/config.py b/rag/config.py similarity index 100% rename from config.py rename to rag/config.py diff --git a/rag.py b/rag/rag.py similarity index 98% rename from rag.py rename to rag/rag.py index 4bea207..3c18e52 100644 --- a/rag.py +++ b/rag/rag.py @@ -28,12 +28,14 @@ import chromadb # ─── Configurazione ─────────────────────────────────────────────────────────── -sys.path.insert(0, str(Path(__file__).parent)) +_here = Path(__file__).parent +project_root = _here.parent +sys.path.insert(0, str(_here)) +sys.path.insert(0, str(project_root)) import config as _cfg from ingestion.config import EMBED_MODEL -project_root = Path(__file__).parent -CHROMA_DIR = project_root / "chroma_db" +CHROMA_DIR = project_root / "chroma_db" OLLAMA_URL = _cfg.OLLAMA_URL LLM_MODEL = _cfg.OLLAMA_MODEL diff --git a/retrieve.py b/rag/retrieve.py similarity index 97% rename from retrieve.py rename to rag/retrieve.py index 946bd4b..3ebdc7d 100644 --- a/retrieve.py +++ b/rag/retrieve.py @@ -34,12 +34,14 @@ import chromadb # ─── Configurazione ─────────────────────────────────────────────────────────── -sys.path.insert(0, str(Path(__file__).parent)) +_here = Path(__file__).parent +project_root = _here.parent +sys.path.insert(0, str(_here)) +sys.path.insert(0, str(project_root)) import config as _cfg from ingestion.config import EMBED_MODEL -project_root = Path(__file__).parent -CHROMA_DIR = project_root / "chroma_db" +CHROMA_DIR = project_root / "chroma_db" OLLAMA_URL = _cfg.OLLAMA_URL TOP_K = _cfg.TOP_K