Files
rag-from-scratch/gui/main.py
T

49 lines
1.6 KiB
Python
Raw Normal View History

#!/usr/bin/env python3
"""
RAG Assistant — GUI desktop.
Uso:
python gui/main.py
python gui/main.py --collection matematica
"""
import argparse
import sys
from pathlib import Path
sys.path.insert(0, str(Path(__file__).parent.parent))
from PySide6.QtWidgets import QApplication
from PySide6.QtGui import QPalette, QColor
from gui.chat_window import ChatWindow
def main() -> None:
parser = argparse.ArgumentParser(description="RAG Assistant GUI")
parser.add_argument("--collection", default="", help="Collection ChromaDB da aprire")
args = parser.parse_args()
app = QApplication(sys.argv)
app.setApplicationName("RAG Assistant")
app.setStyle("Fusion")
# Palette scura per i widget nativi Qt
palette = QPalette()
palette.setColor(QPalette.ColorRole.Window, QColor("#212121"))
palette.setColor(QPalette.ColorRole.WindowText, QColor("#ececec"))
palette.setColor(QPalette.ColorRole.Base, QColor("#2a2a2a"))
palette.setColor(QPalette.ColorRole.AlternateBase, QColor("#1a1a1a"))
palette.setColor(QPalette.ColorRole.Text, QColor("#ececec"))
palette.setColor(QPalette.ColorRole.Button, QColor("#2a2a2a"))
palette.setColor(QPalette.ColorRole.ButtonText, QColor("#ececec"))
palette.setColor(QPalette.ColorRole.Highlight, QColor("#10a37f"))
palette.setColor(QPalette.ColorRole.HighlightedText, QColor("#ffffff"))
app.setPalette(palette)
window = ChatWindow(default_collection=args.collection)
window.show()
sys.exit(app.exec())
if __name__ == "__main__":
main()