""" FILE: app/frontend/ui.py DESCRIPTION: Main Entrypoint für Streamlit. Router, der basierend auf Sidebar-Auswahl die Module (Chat, Editor, Graph) lädt. VERSION: 2.6.0 STATUS: Active DEPENDENCIES: streamlit, ui_config, ui_sidebar, ui_chat, ui_editor, ui_graph_service, ui_graph*, ui_graph_cytoscape LAST_ANALYSIS: 2025-12-15 """ import streamlit as st import uuid # --- CONFIG & STYLING --- st.set_page_config(page_title="mindnet v2.6", page_icon="🧠", layout="wide") st.markdown(""" """, unsafe_allow_html=True) # --- MODULE IMPORTS --- try: from ui_config import QDRANT_URL, QDRANT_KEY, COLLECTION_PREFIX from ui_graph_service import GraphExplorerService # Komponenten from ui_sidebar import render_sidebar from ui_chat import render_chat_interface from ui_editor import render_manual_editor # Die beiden Graph-Engines from ui_graph import render_graph_explorer as render_graph_agraph from ui_graph_cytoscape import render_graph_explorer_cytoscape # <-- Import except ImportError as e: st.error(f"Import Error: {e}. Bitte stelle sicher, dass alle UI-Dateien im Ordner liegen und 'streamlit-cytoscapejs' installiert ist.") st.stop() # --- SESSION STATE --- if "messages" not in st.session_state: st.session_state.messages = [] if "user_id" not in st.session_state: st.session_state.user_id = str(uuid.uuid4()) # --- SERVICE INIT --- graph_service = GraphExplorerService(QDRANT_URL, QDRANT_KEY, COLLECTION_PREFIX) # --- MAIN ROUTING --- mode, top_k, explain = render_sidebar() if mode == "💬 Chat": render_chat_interface(top_k, explain) elif mode == "📝 Manueller Editor": render_manual_editor() elif mode == "🕸️ Graph (Agraph)": render_graph_agraph(graph_service) elif mode == "🕸️ Graph (Cytoscape)": render_graph_explorer_cytoscape(graph_service)