Merge pull request #2002 from Yanyutin753/addAudio

🤩 Added custom openai tts models and role variables
This commit is contained in:
Timothy Jaeryang Baek
2024-05-08 08:03:20 -07:00
committed by GitHub
34 changed files with 89 additions and 7 deletions
+3 -2
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
})