fix(admin): TTS-Test-Button nutzt jetzt richtigen Provider (v15)
piper_voice, openrouter_tts_model und openrouter_tts_voice bekommen 'testProvider' in FIELD_META. Der Test-Handler schickt diesen Provider als tts_provider im Request mit — statt immer den System-Default zu nutzen, der oft openrouter ist und dann mit 502 scheitert. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
4a4cbe643d
commit
11ae66f5ae
2 changed files with 7 additions and 5 deletions
|
|
@ -982,9 +982,9 @@ const FIELD_META = {
|
||||||
default_language: { ui: "combo", opts: ["de","en","fr","es","it","nl"],
|
default_language: { ui: "combo", opts: ["de","en","fr","es","it","nl"],
|
||||||
labels: { de:"Deutsch",en:"Englisch",fr:"Französisch",es:"Spanisch",it:"Italienisch",nl:"Niederländisch" } },
|
labels: { de:"Deutsch",en:"Englisch",fr:"Französisch",es:"Spanisch",it:"Italienisch",nl:"Niederländisch" } },
|
||||||
openrouter_llm_model: { ui: "combo", opts: ["google/gemini-3.1-flash-lite","openai/gpt-4.1-mini","google/gemini-2.5-flash","anthropic/claude-haiku-4-5-20251001","meta-llama/llama-3.3-70b-instruct"], test: "llm" },
|
openrouter_llm_model: { ui: "combo", opts: ["google/gemini-3.1-flash-lite","openai/gpt-4.1-mini","google/gemini-2.5-flash","anthropic/claude-haiku-4-5-20251001","meta-llama/llama-3.3-70b-instruct"], test: "llm" },
|
||||||
openrouter_tts_model: { ui: "combo", opts: ["google/gemini-3.1-flash-tts-preview","openai/gpt-4o-mini-tts"], test: "tts" },
|
openrouter_tts_model: { ui: "combo", opts: ["google/gemini-3.1-flash-tts-preview","openai/gpt-4o-mini-tts"], test: "tts", testProvider: "openrouter" },
|
||||||
openrouter_tts_voice: { ui: "combo", opts: ["Zephyr","Puck","Charon","Kore","Fenrir","Leda","Orus","Aoede","Callirrhoe","Enceladus","Algieba","Despina","Achernar"], test: "tts" },
|
openrouter_tts_voice: { ui: "combo", opts: ["Zephyr","Puck","Charon","Kore","Fenrir","Leda","Orus","Aoede","Callirrhoe","Enceladus","Algieba","Despina","Achernar"], test: "tts", testProvider: "openrouter" },
|
||||||
piper_voice: { ui: "combo", opts: ["de_DE-thorsten-high","de_DE-kerstin-low","de_DE-karlsson-low"], test: "tts" },
|
piper_voice: { ui: "combo", opts: ["de_DE-thorsten-high","de_DE-kerstin-low","de_DE-karlsson-low"], test: "tts", testProvider: "piper" },
|
||||||
local_llm_system_prompt: { ui: "textarea", test: "llm" },
|
local_llm_system_prompt: { ui: "textarea", test: "llm" },
|
||||||
local_llm_temperature: { ui: "range", min: 0, max: 2, step: 0.1, test: "llm" },
|
local_llm_temperature: { ui: "range", min: 0, max: 2, step: 0.1, test: "llm" },
|
||||||
local_llm_max_tokens: { ui: "number", min: 0, test: "llm" },
|
local_llm_max_tokens: { ui: "number", min: 0, test: "llm" },
|
||||||
|
|
@ -1207,9 +1207,11 @@ function buildSettingRow(item) {
|
||||||
testBtnEl.disabled = true;
|
testBtnEl.disabled = true;
|
||||||
try {
|
try {
|
||||||
if (testType === "tts") {
|
if (testType === "tts") {
|
||||||
|
const body = { text: "Hallo, ich bin der Sprachassistent." };
|
||||||
|
if (meta.testProvider) body.tts_provider = meta.testProvider;
|
||||||
const r = await fetch("/api/speak", {
|
const r = await fetch("/api/speak", {
|
||||||
method: "POST", headers: { "Content-Type": "application/json" },
|
method: "POST", headers: { "Content-Type": "application/json" },
|
||||||
body: JSON.stringify({ text: "Hallo, ich bin der Sprachassistent." }),
|
body: JSON.stringify(body),
|
||||||
});
|
});
|
||||||
if (!r.ok) throw new Error("HTTP " + r.status);
|
if (!r.ok) throw new Error("HTTP " + r.status);
|
||||||
const buf = await r.arrayBuffer();
|
const buf = await r.arrayBuffer();
|
||||||
|
|
|
||||||
|
|
@ -218,6 +218,6 @@
|
||||||
<div id="status" class="w-full max-w-3xl mx-auto mt-1 min-h-[1rem] text-xs text-slate-500 dark:text-slate-400"></div>
|
<div id="status" class="w-full max-w-3xl mx-auto mt-1 min-h-[1rem] text-xs text-slate-500 dark:text-slate-400"></div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<script src="/app.js?v=14"></script>
|
<script src="/app.js?v=15"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue