36 lines
1.2 KiB
Python
36 lines
1.2 KiB
Python
import streamlit as st
|
|
from ui_utils import load_history_from_logs
|
|
from ui_config import HISTORY_FILE
|
|
|
|
def render_sidebar():
|
|
with st.sidebar:
|
|
st.title("🧠 mindnet")
|
|
st.caption("v2.6 | WP-19 Graph View")
|
|
|
|
if "sidebar_mode_selection" not in st.session_state:
|
|
st.session_state["sidebar_mode_selection"] = "💬 Chat"
|
|
|
|
mode = st.radio(
|
|
"Modus",
|
|
[
|
|
"💬 Chat",
|
|
"📝 Manueller Editor",
|
|
"🕸️ Graph (Agraph)",
|
|
"🕸️ Graph (Cytoscape)" # <-- Neuer Punkt
|
|
],
|
|
key="sidebar_mode_selection"
|
|
)
|
|
|
|
st.divider()
|
|
st.subheader("⚙️ Settings")
|
|
top_k = st.slider("Quellen (Top-K)", 1, 10, 5)
|
|
explain = st.toggle("Explanation Layer", True)
|
|
|
|
st.divider()
|
|
st.subheader("🕒 Verlauf")
|
|
for q in load_history_from_logs(HISTORY_FILE, 8):
|
|
if st.button(f"🔎 {q[:25]}...", key=f"hist_{q}", use_container_width=True):
|
|
st.session_state.messages.append({"role": "user", "content": q})
|
|
st.rerun()
|
|
|
|
return mode, top_k, explain |