feat: settings web UI (models / STT / TTS speed / language / LLM instructions)

Adds /settings (served by the bridge) to change the LLM model (from installed
Ollama models), Whisper model, TTS engine + MeloTTS speed, output language,
agentic max-turns, thinking mode, and free-form LLM instructions — live, with a
'apply' that restarts the bridge + TTS worker. Settings persist to the runtime
config JSON; engine reads output_language + llm_instructions and the TTS worker
reads melo_speed from it. Bridge port publishable for access.
This commit is contained in:
javis-bot
2026-06-15 13:05:46 +09:00
parent 3bdc7d078a
commit 84e435f916
6 changed files with 233 additions and 2 deletions

View File

@@ -52,11 +52,18 @@ from flask import Flask, request, jsonify, Response, stream_with_context
try: # package-relative when imported as ``bridge.server``
from bridge.text_utils import split_sentences
from bridge.stt_filter import filter_speech_segments, has_speech
from bridge import settings_web
except ImportError: # script-relative when run as ``bridge/server.py``
from text_utils import split_sentences
from stt_filter import filter_speech_segments, has_speech
import settings_web
app = Flask(__name__)
# Settings web UI (/settings) — change models/language/TTS/instructions live.
try:
settings_web.register(app)
except Exception as _e: # pragma: no cover - never block the bridge on the UI
print(f"[bridge] settings UI unavailable: {_e}", flush=True)
# ---------------------------------------------------------------------------
# Configuration (env-driven; see .env.example)