debut illustration

This commit is contained in:
pporcheret
2026-11-02 08:50:05 +01:00
parent e2340807aa
commit c2a4f7eb26
44 changed files with 6856 additions and 19 deletions
+29
View File
@@ -209,6 +209,31 @@ def build_dashboard(prompt, ask_hermes):
if source=='spotify':return _live_spotify(prompt)
if source=='temperatures':return _live_temperatures(prompt)
if source=='lights':return _live_lights(prompt)
# DONA_DYNAMIC_PROXMOX_V3 — try data-only read-only mode for standard boards.
from services.dona_proxmox_direct import (
is_standard_proxmox, build_standard_dashboard, ProxmoxDirectUnavailable
)
if is_standard_proxmox(prompt):
import logging as _dona_logging
import time as _dona_time
_direct_start = _dona_time.monotonic()
try:
_direct_board = normalize_dashboard(build_standard_dashboard(prompt), prompt=prompt)
_direct_board['origin'] = 'proxmox'
_dona_logging.getLogger('dona.proxmox').warning(
'[DONA-DIRECT] source=proxmox outcome=ok elapsed_ms=%.1f',
(_dona_time.monotonic()-_direct_start)*1000
)
return _direct_board
except ProxmoxDirectUnavailable as _direct_exc:
_dona_reason = str(_direct_exc)
except Exception:
_dona_reason = 'erreur_interne'
_dona_logging.getLogger('dona.proxmox').warning(
'[DONA-DIRECT] source=proxmox outcome=fallback reason=%s elapsed_ms=%.1f',
_dona_reason, (_dona_time.monotonic()-_direct_start)*1000
)
# Existing Hermes/MCP implementation remains the safe fallback.
instruction=(
'Demande originale : '+prompt+'\n\n'
'Interroge d’abord les outils disponibles (MCP) pour obtenir les données réelles. '
@@ -251,6 +276,10 @@ def register_dynamic(app, submit):
if source=='spotify':board=_live_spotify('Tableau Spotify')
elif source=='homeassistant':board=_live_temperatures('Tableau températures')
elif source=='lights':board=_live_lights('Tableau lumières')
elif source=='proxmox':
from services.dona_proxmox_direct import build_standard_dashboard
board=normalize_dashboard(build_standard_dashboard('Tableau de bord Proxmox'), prompt='Tableau de bord Proxmox')
board['origin']='proxmox'
else:return jsonify(ok=False,error='Source invalide.'),400
response=jsonify(ok=True,dashboard=board)
response.headers['Cache-Control']='no-store, private'