diff --git a/gui/chat.html b/gui/chat.html
index 7c48837..1454726 100644
--- a/gui/chat.html
+++ b/gui/chat.html
@@ -226,7 +226,7 @@ function addMessage(role, content, sources) {
const doc = s.source || '';
const path = s.header_path || '';
chip.innerHTML = path
- ? `${esc(doc)} βΊ ${esc(path)}`
+ ? `${esc(doc)} > ${esc(path)}`
: `${esc(doc)}`;
srcDiv.appendChild(chip);
});
diff --git a/gui/chat_window.py b/gui/chat_window.py
index 20d1cd6..ae466f0 100644
--- a/gui/chat_window.py
+++ b/gui/chat_window.py
@@ -46,8 +46,8 @@ _THEMES = {
padding:8px 12px; font-size:14px;
}
""",
- "theme_btn": "background:#2a2a2a; color:#ececec; border:1px solid #3a3a3a; border-radius:6px; font-size:16px; padding:4px 8px;",
- "icon": "βοΈ",
+ "theme_btn": "background:#2a2a2a; color:#ececec; border:1px solid #3a3a3a; border-radius:6px; font-size:12px; font-weight:600; padding:4px 8px;",
+ "icon": "Chiaro",
},
"light": {
"topbar": "background:#f5f5f5; border-bottom:1px solid #e0e0e0;",
@@ -72,8 +72,8 @@ _THEMES = {
padding:8px 12px; font-size:14px;
}
""",
- "theme_btn": "background:#fff; color:#1a1a1a; border:1px solid #ddd; border-radius:6px; font-size:16px; padding:4px 8px;",
- "icon": "π",
+ "theme_btn": "background:#fff; color:#1a1a1a; border:1px solid #ddd; border-radius:6px; font-size:12px; font-weight:600; padding:4px 8px;",
+ "icon": "Scuro",
},
}
@@ -130,7 +130,7 @@ class ChatWindow(QMainWindow):
tl.addStretch()
self._theme_btn = QPushButton()
- self._theme_btn.setFixedSize(36, 30)
+ self._theme_btn.setFixedSize(60, 30)
self._theme_btn.setToolTip("Cambia tema")
self._theme_btn.clicked.connect(self._toggle_theme)
tl.addWidget(self._theme_btn)
@@ -212,7 +212,7 @@ class ChatWindow(QMainWindow):
if not question:
return
if not self._collection:
- self._js("addMessage('assistant', 'β οΈ Seleziona una collezione prima di inviare.', [])")
+ self._js("addMessage('assistant', 'Seleziona una collezione prima di inviare.', [])")
return
self._input.clear()
@@ -236,7 +236,7 @@ class ChatWindow(QMainWindow):
def _on_error(self, msg: str) -> None:
self._js("removeThinking()")
- self._js(f"addMessage('assistant', {json.dumps('β Errore: ' + msg)}, [])")
+ self._js(f"addMessage('assistant', {json.dumps('Errore: ' + msg)}, [])")
self._set_enabled(True)
# ββ Helpers βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
diff --git a/ingestion/ingest.py b/ingestion/ingest.py
index d02383e..e68c673 100644
--- a/ingestion/ingest.py
+++ b/ingestion/ingest.py
@@ -83,13 +83,13 @@ def check_ollama(model: str) -> bool:
for m in models
)
if found:
- print(f"β
Ollama OK β {model} disponibile")
+ print(f"Ollama OK β {model} disponibile")
return True
- print(f"β Modello {model} non trovato in Ollama")
+ print(f"ERRORE: Modello {model} non trovato in Ollama")
print(f" β ollama pull {model}")
return False
except (urllib.error.URLError, OSError):
- print("β Ollama non raggiungibile β assicurati che sia in esecuzione")
+ print("ERRORE: Ollama non raggiungibile β assicurati che sia in esecuzione")
print(" β ollama serve")
return False
@@ -116,18 +116,18 @@ def _ingest_stem(stem: str, collection: chromadb.Collection,
"""
chunks_path = CHUNKS_DIR / stem / "chunks.json"
if not chunks_path.exists():
- print(f"β File non trovato: {chunks_path}")
+ print(f"ERRORE: File non trovato: {chunks_path}")
return 0
with open(chunks_path, encoding="utf-8") as f:
chunks = json.load(f)
if not chunks:
- print(f"β οΈ {stem}: chunks.json Γ¨ vuoto β skip")
+ print(f"AVVISO: {stem}: chunks.json e' vuoto β skip")
return 0
total = len(chunks)
- print(f" π {stem}: {total} chunk\n")
+ print(f" {stem}: {total} chunk\n")
ids = []
embeddings = []
@@ -167,7 +167,7 @@ def _ingest_stem(stem: str, collection: chromadb.Collection,
eta = int(avg * (total - i))
done = f"[{offset + i:>6}/{offset + total}]"
cid = chunk["chunk_id"][:40]
- print(f" {done} β {stem}/{cid:<40} ETA: {eta}s", end="\r", flush=True)
+ print(f" {done} {stem}/{cid:<40} ETA: {eta}s", end="\r", flush=True)
if len(ids) == 100:
collection.add(ids=ids, embeddings=embeddings,
@@ -180,7 +180,7 @@ def _ingest_stem(stem: str, collection: chromadb.Collection,
elapsed = int(time.monotonic() - start)
print()
- print(f" β
{stem}: {total} chunk in {elapsed}s")
+ print(f" OK {stem}: {total} chunk in {elapsed}s")
return total
@@ -200,11 +200,11 @@ def ingest_multi(stems: list[str], collection_name: str,
if collection_exists(client, collection_name):
if not force:
- print(f"β οΈ Collection '{collection_name}' giΓ presente in ChromaDB β skip")
+ print(f"AVVISO: Collection '{collection_name}' gia' presente in ChromaDB β skip")
print(f" β usa --force per sovrascrivere")
return True
client.delete_collection(collection_name)
- print(f"ποΈ Collection '{collection_name}' rimossa (--force)")
+ print(f"Collection '{collection_name}' rimossa (--force)")
collection = client.create_collection(
name=collection_name,
@@ -218,7 +218,7 @@ def ingest_multi(stems: list[str], collection_name: str,
return False
total_chunks += n
- print(f"\nβ
Collection '{collection_name}': {total_chunks} chunk totali")
+ print(f"\nOK Collection '{collection_name}': {total_chunks} chunk totali")
print(f" Documenti: {', '.join(stems)}")
print(f" Percorso: {CHROMA_DIR}/")
return True
@@ -266,10 +266,10 @@ def main() -> int:
# ββ ModalitΓ multi-documento βββββββββββββββββββββββββββββββββββββββββββββ
if args.stems or args.collection:
if not args.stems:
- print("β --collection richiede --stems (es. --stems doc1 doc2 doc3)")
+ print("ERRORE: --collection richiede --stems (es. --stems doc1 doc2 doc3)")
return 1
if not args.collection:
- print("β --stems richiede --collection (es. --collection archivio)")
+ print("ERRORE: --stems richiede --collection (es. --collection archivio)")
return 1
print(f" Collection : {args.collection}")
print(f" Documenti : {', '.join(args.stems)}\n")
@@ -280,7 +280,7 @@ def main() -> int:
# ββ ModalitΓ singolo / tutti βββββββββββββββββββββββββββββββββββββββββββββ
stems = [args.stem] if args.stem else find_stems()
if not stems:
- print("β Nessun chunks.json trovato in chunks/")
+ print("ERRORE: Nessun chunks.json trovato in chunks/")
return 1
results = []
diff --git a/rag/rag.py b/rag/rag.py
index 3c18e52..4eae5e6 100644
--- a/rag/rag.py
+++ b/rag/rag.py
@@ -133,7 +133,7 @@ def answer(question: str, collection: chromadb.Collection, verbose: bool) -> Non
try:
chunks = retrieve(collection, question)
except (urllib.error.URLError, OSError) as e:
- print(f"β Errore embedding: {e}")
+ print(f"ERRORE embedding: {e}")
return
if verbose:
@@ -151,7 +151,7 @@ def answer(question: str, collection: chromadb.Collection, verbose: bool) -> Non
try:
response = call_ollama(prompt, system=system)
except (urllib.error.URLError, OSError) as e:
- print(f"β Errore generazione: {e}")
+ print(f"ERRORE generazione: {e}")
return
print(f"\n{response}\n")
@@ -234,13 +234,13 @@ def main() -> int:
print()
if not CHROMA_DIR.exists():
- print("β chroma_db/ non trovata β esegui prima ingestion")
+ print("ERRORE: 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 collection_name not in collections:
- print(f"β Collection '{collection_name}' non trovata in chroma_db/")
+ print(f"ERRORE: Collection '{collection_name}' non trovata in chroma_db/")
if args.stem:
print(f" β python ingestion/ingest.py --stem {collection_name}")
else:
@@ -248,7 +248,7 @@ def main() -> int:
return 1
collection = client.get_collection(collection_name)
- print(f"β
Collection '{collection_name}' caricata ({collection.count()} chunk)\n")
+ print(f"OK Collection '{collection_name}' caricata ({collection.count()} chunk)\n")
run_loop(collection)
return 0
diff --git a/rag/retrieve.py b/rag/retrieve.py
index 3ebdc7d..866a8d8 100644
--- a/rag/retrieve.py
+++ b/rag/retrieve.py
@@ -134,7 +134,7 @@ def run_loop(collection: chromadb.Collection, top_k: int) -> None:
try:
chunks = retrieve(collection, query, top_k)
except (urllib.error.URLError, OSError) as e:
- print(f"β Errore embedding (Ollama raggiungibile?): {e}\n")
+ print(f"ERRORE embedding (Ollama raggiungibile?): {e}\n")
continue
print()
@@ -204,13 +204,13 @@ def main() -> int:
print()
if not CHROMA_DIR.exists():
- print("β chroma_db/ non trovata β esegui prima ingestion", file=sys.stderr)
+ print("ERRORE: chroma_db/ non trovata β esegui prima ingestion", file=sys.stderr)
return 1
client = chromadb.PersistentClient(path=str(CHROMA_DIR))
collections = [c.name for c in client.list_collections()]
if collection_name not in collections:
- print(f"β Collection '{collection_name}' non trovata in chroma_db/", file=sys.stderr)
+ print(f"ERRORE: Collection '{collection_name}' non trovata in chroma_db/", file=sys.stderr)
if args.stem:
print(f" β python ingestion/ingest.py --stem {collection_name}", file=sys.stderr)
else:
@@ -218,7 +218,7 @@ def main() -> int:
return 1
collection = client.get_collection(collection_name)
- print(f"β
Collection '{collection_name}' caricata ({collection.count()} chunk)\n")
+ print(f"OK Collection '{collection_name}' caricata ({collection.count()} chunk)\n")
run_loop(collection, args.top_k)
return 0