refactor: sposta rag.py, retrieve.py, config.py in cartella rag/
- rag/config.py, rag/rag.py, rag/retrieve.py (spostati da radice) - rag/__init__.py aggiunto per import come package - path aggiornati: project_root = Path(__file__).parent.parent - ollama/check_env.py: import da ingestion.config e rag.config - ollama/test_ollama.py: import da rag.config Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+2
-1
@@ -62,7 +62,8 @@ def _parse_ollama_models(raw_output: str) -> list[str]:
|
|||||||
|
|
||||||
sys.path.insert(0, str(Path(__file__).parent.parent))
|
sys.path.insert(0, str(Path(__file__).parent.parent))
|
||||||
try:
|
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:
|
except Exception:
|
||||||
CONFIGURED_EMBED = None
|
CONFIGURED_EMBED = None
|
||||||
CONFIGURED_LLM = None
|
CONFIGURED_LLM = None
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import urllib.request
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
sys.path.insert(0, str(Path(__file__).parent.parent))
|
sys.path.insert(0, str(Path(__file__).parent.parent))
|
||||||
import config as _cfg
|
from rag import config as _cfg
|
||||||
|
|
||||||
OLLAMA_URL = _cfg.OLLAMA_URL
|
OLLAMA_URL = _cfg.OLLAMA_URL
|
||||||
MODEL = _cfg.OLLAMA_MODEL
|
MODEL = _cfg.OLLAMA_MODEL
|
||||||
|
|||||||
+4
-2
@@ -28,11 +28,13 @@ import chromadb
|
|||||||
|
|
||||||
# ─── Configurazione ───────────────────────────────────────────────────────────
|
# ─── 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
|
import config as _cfg
|
||||||
from ingestion.config import EMBED_MODEL
|
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
|
OLLAMA_URL = _cfg.OLLAMA_URL
|
||||||
@@ -34,11 +34,13 @@ import chromadb
|
|||||||
|
|
||||||
# ─── Configurazione ───────────────────────────────────────────────────────────
|
# ─── 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
|
import config as _cfg
|
||||||
from ingestion.config import EMBED_MODEL
|
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
|
OLLAMA_URL = _cfg.OLLAMA_URL
|
||||||
Reference in New Issue
Block a user