From 7060618a5989833df56d8100cb91d140800bec92 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 9 Mar 2026 13:10:57 +0700 Subject: [PATCH] =?UTF-8?q?feat:=20context.py=20=E2=80=94=20WordPress-Date?= =?UTF-8?q?n=20in=20LLM-Kontext=20einbauen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bei Fragen zu wordpress/blog/post/artikel etc. wird wordpress_client.format_overview() automatisch geladen. Bot kann jetzt auf Fragen antworten wie: - "Wie viele Posts heute?" - "Gibt es pending Kommentare?" - "Welche Plugins sind aktiv?" Made-with: Cursor --- homelab-ai-bot/context.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/homelab-ai-bot/context.py b/homelab-ai-bot/context.py index f09aaa17..74b5f052 100644 --- a/homelab-ai-bot/context.py +++ b/homelab-ai-bot/context.py @@ -6,7 +6,7 @@ import os import re sys.path.insert(0, os.path.dirname(__file__)) -from core import config, loki_client, proxmox_client +from core import config, loki_client, proxmox_client, wordpress_client def _load_config(): @@ -143,6 +143,12 @@ def gather_context_for_question(question: str) -> str: if any(w in q for w in ["still", "silence", "stumm", "logs"]): parts.append("=== Stille Hosts ===\n" + gather_silence()) + # WordPress-Daten für Blog-Fragen + if any(w in q for w in ["wordpress", "blog", "post", "artikel", "kommentar", "plugin"]): + cfg = _load_config() + wp_overview = wordpress_client.format_overview(cfg) + parts.append("=== WordPress ===\n" + wp_overview) + ct_match = re.search(r'\bct[- ]?(\d{3})\b', q) if ct_match: parts.append(f"=== CT {ct_match.group(1)} ===\n" + gather_container_status(ct_match.group(1)))