feat(ui): add TTS voice suggestions dropdown to model editor

This commit is contained in:
silentoplayz 2026-06-04 05:54:50 -04:00 • committed by silentoplayz
parent 30a7257928
commit 5df3e3f5e5

View file

@ -9,6 +9,7 @@
import { getSkills } from '$lib/apis/skills';
import { getFunctions } from '$lib/apis/functions';
import { getModelsDefaults } from '$lib/apis/configs';
import { getVoices } from '$lib/apis/audio';
import AdvancedParams from '$lib/components/chat/Settings/Advanced/AdvancedParams.svelte';
import Tags from '$lib/components/common/Tags.svelte';
@ -108,6 +109,7 @@
let terminalId = '';
let tts = { voice: '' };
let suggestionTags = [];
let voices = [];
const submitHandler = async () => {
loading = true;
@ -263,6 +265,11 @@
suggestionTags = modelTags.map((t) => ({ name: t }));
}
const voicesRes = await getVoices(localStorage.token).catch(() => null);
if (voicesRes) {
voices = voicesRes.voices;
}
// Fetch admin-configured default model metadata so the editor
// reflects the actual defaults rather than hardcoded values
const modelsConfig = await getModelsDefaults(localStorage.token).catch(() => null);
@ -854,8 +861,15 @@
class="w-full text-sm bg-transparent outline-hidden"
type="text"
bind:value={tts.voice}
list="tts-voice-list"
placeholder={$i18n.t('e.g. alloy, echo, shimmer')}
/>
<datalist id="tts-voice-list">
{#each voices as v}
<option value={v.id}>{v.name}</option>
{/each}
</datalist>
</div>
<hr class=" border-gray-100/30 dark:border-gray-850/30 my-4" />