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)