diff --git a/app.py b/app.py index 304d38a..90a549a 100644 --- a/app.py +++ b/app.py @@ -1496,12 +1496,92 @@ def admin_dashboard(): BSN Intake β€” Admin + - +
@@ -1589,9 +1669,21 @@ def admin_comments(): Kommentar-Moderation β€” BSN Admin - + - +
BSN

πŸ’¬ Kommentar-Moderation

← ZurΓΌck zum Admin
@@ -1635,7 +1727,12 @@ def test_page(): return """ Simulierter Test - + Brettspiel News

πŸ§ͺ Simulierter WhatsApp Test

@@ -1763,9 +1860,105 @@ def submission_detail(sub_id: int): #{row['id']} β€” BSN + - +
← ZurΓΌck @@ -2046,7 +2239,17 @@ def submission_done(sub_id: int): db.commit() return """ - +
βœ… Beitrag als erledigt markiert
@@ -2147,7 +2350,17 @@ def submission_delete(sub_id: int): db.commit() return f""" - +
πŸ—‘οΈ Beitrag #{sub_id} gelΓΆscht
@@ -2445,7 +2658,14 @@ def public_frontend(): - +

Bald geht's los!

Noch keine ver\u00f6ffentlichten Beitr\u00e4ge. Komm bald wieder β€” die Community f\u00fcllt diesen Ort mit spannenden Geschichten.

""" @@ -2649,6 +2869,286 @@ def public_frontend(): + @@ -3288,6 +3788,39 @@ def _overlay_page(title, content_html, max_width="640px"): + @@ -3735,16 +4268,8 @@ def api_chat(): f"KONTEXT (verΓΆffentlichte Community-BeitrΓ€ge + SPIEL Essen Aussteller):\n{context[:10000]}" ) - # Read API key - config_path = os.path.expanduser("~/.hermes/config.yaml") - api_key = "" - try: - with open(config_path) as f: - import yaml as _yaml - cfg = _yaml.safe_load(f) - api_key = cfg.get("providers", {}).get("datenhimmel", {}).get("api_key", "") - except Exception: - pass + # Read Mistral API key from environment + api_key = os.environ.get("MISTRAL_API_KEY", "") if not api_key: return jsonify({'reply': 'BSN Assistent ist aktuell nicht verfΓΌgbar (API-Key fehlt).'}) @@ -3759,9 +4284,9 @@ def api_chat(): try: r = requests.post( - "https://ui.datenhimmel.work/api/chat/completions", + "https://api.mistral.ai/v1/chat/completions", headers={"Authorization": f"Bearer {api_key}", "Content-Type": "application/json"}, - json={"model": "deepseek-v4-flash:cloud", "messages": messages, "max_tokens": 400, "temperature": 0.4}, + json={"model": "ministral-3b-latest", "messages": messages, "max_tokens": 400, "temperature": 0.4}, timeout=15, ) if r.status_code != 200: @@ -4082,9 +4607,85 @@ def public_detail(sub_id: int): + - +