refactor: rinomina step-8 → ingestion
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -197,7 +197,7 @@ def _build_epilog() -> str:
|
||||
if names:
|
||||
lines += ["", f"Collection disponibili: {', '.join(names)}"]
|
||||
else:
|
||||
lines += ["", "Nessuna collection trovata — eseguire prima: python step-8/ingest.py"]
|
||||
lines += ["", "Nessuna collection trovata — eseguire prima: python ingestion/ingest.py"]
|
||||
except Exception:
|
||||
pass
|
||||
return "\n".join(lines)
|
||||
@@ -208,7 +208,7 @@ def main() -> int:
|
||||
description=(
|
||||
"Pipeline RAG interattiva\n\n"
|
||||
"Risponde a domande in linguaggio naturale su un documento\n"
|
||||
"indicizzato in ChromaDB da step-8/ingest.py."
|
||||
"indicizzato in ChromaDB da ingestion/ingest.py."
|
||||
),
|
||||
epilog=_build_epilog(),
|
||||
formatter_class=argparse.RawDescriptionHelpFormatter,
|
||||
@@ -218,7 +218,7 @@ def main() -> int:
|
||||
required=True,
|
||||
help=(
|
||||
"Nome della collection ChromaDB da interrogare. "
|
||||
"Le collection vengono create da: python step-8/ingest.py --stem <nome>"
|
||||
"Le collection vengono create da: python ingestion/ingest.py --stem <nome>"
|
||||
),
|
||||
)
|
||||
args = parser.parse_args()
|
||||
@@ -231,14 +231,14 @@ def main() -> int:
|
||||
print()
|
||||
|
||||
if not CHROMA_DIR.exists():
|
||||
print("❌ chroma_db/ non trovata — esegui prima step-8")
|
||||
print("❌ chroma_db/ non trovata — esegui prima ingestion")
|
||||
return 1
|
||||
|
||||
client = chromadb.PersistentClient(path=str(CHROMA_DIR))
|
||||
collections = [c.name for c in client.list_collections()]
|
||||
if args.stem not in collections:
|
||||
print(f"❌ Collection '{args.stem}' non trovata in chroma_db/")
|
||||
print(f" → python step-8/ingest.py --stem {args.stem}")
|
||||
print(f" → python ingestion/ingest.py --stem {args.stem}")
|
||||
return 1
|
||||
|
||||
collection = client.get_collection(args.stem)
|
||||
|
||||
Reference in New Issue
Block a user