update the name

This commit is contained in:
Yanyutin753
2024-05-07 08:28:34 +08:00
parent 5f7188b480
commit 5d6517c537
6 changed files with 23 additions and 23 deletions

View File

@@ -98,7 +98,7 @@ export const synthesizeOpenAISpeech = async (
token: string = '',
speaker: string = 'alloy',
text: string = '',
OpenAIModel: string = 'tts-1'
model: string = 'tts-1'
) => {
let error = null;
@@ -109,7 +109,7 @@ export const synthesizeOpenAISpeech = async (
'Content-Type': 'application/json'
},
body: JSON.stringify({
model: OpenAIModel,
model: model,
input: text,
voice: speaker
})

View File

@@ -224,7 +224,7 @@
localStorage.token,
$settings?.audio?.speaker,
sentence,
$settings?.audio?.OpenAIModel
$settings?.audio?.model
).catch((error) => {
toast.error(error);

View File

@@ -27,7 +27,7 @@
let voices = [];
let speaker = '';
let models = [];
let OpenAIModel = '';
let model = '';
const getOpenAIVoices = () => {
voices = [
@@ -85,15 +85,15 @@
const res = await updateAudioConfig(localStorage.token, {
url: OpenAIUrl,
key: OpenAIKey,
model: OpenAIModel,
speaker: speaker,
model: model,
speaker: speaker
});
if (res) {
OpenAIUrl = res.OPENAI_API_BASE_URL;
OpenAIKey = res.OPENAI_API_KEY;
OpenAIModel = res.OPENAI_API_MODEL;
speaker = res.OPENAI_API_SPEAKER;
model = res.OPENAI_API_MODEL;
speaker = res.OPENAI_API_VOICE;
}
}
};
@@ -108,7 +108,7 @@
STTEngine = settings?.audio?.STTEngine ?? '';
TTSEngine = settings?.audio?.TTSEngine ?? '';
speaker = settings?.audio?.speaker ?? '';
OpenAIModel = settings?.audio?.OpenAIModel ?? '';
model = settings?.audio?.model ?? '';
if (TTSEngine === 'openai') {
getOpenAIVoices();
@@ -123,8 +123,8 @@
if (res) {
OpenAIUrl = res.OPENAI_API_BASE_URL;
OpenAIKey = res.OPENAI_API_KEY;
OpenAIModel = res.OPENAI_API_MODEL;
speaker = res.OPENAI_API_SPEAKER;
model = res.OPENAI_API_MODEL;
speaker = res.OPENAI_API_VOICE;
}
}
});
@@ -141,7 +141,7 @@
STTEngine: STTEngine !== '' ? STTEngine : undefined,
TTSEngine: TTSEngine !== '' ? TTSEngine : undefined,
speaker: speaker !== '' ? speaker : undefined,
OpenAIModel: OpenAIModel !== '' ? OpenAIModel : undefined
model: model !== '' ? model : undefined
}
});
dispatch('save');
@@ -230,7 +230,7 @@
if (e.target.value === 'openai') {
getOpenAIVoices();
speaker = 'alloy';
OpenAIModel = 'tts-1';
model = 'tts-1';
} else {
getWebAPIVoices();
speaker = '';
@@ -330,13 +330,13 @@
<input
list="model-list"
class="w-full rounded-lg py-2 px-4 text-sm dark:text-gray-300 dark:bg-gray-850 outline-none"
bind:value={OpenAIModel}
bind:value={model}
placeholder="Select a model"
/>
<datalist id="model-list">
{#each models as OpenAIMode}
<option value={OpenAIMode.name} />
{#each models as model}
<option value={model.name} />
{/each}
</datalist>
</div>

View File

@@ -102,7 +102,7 @@ type AudioSettings = {
STTEngine?: string;
TTSEngine?: string;
speaker?: string;
OpenAIModel?: string;
model?: string;
};
type TitleSettings = {