🤩 Added custom openai tts models and role variables

This commit is contained in:
Yanyutin753
2024-05-06 15:23:27 +08:00
parent e92311b4eb
commit 761c66a8d8
34 changed files with 89 additions and 7 deletions

View File

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