🤩 Added custom openai tts models and role variables
This commit is contained in:
@@ -30,6 +30,8 @@ export const getAudioConfig = async (token: string) => {
|
||||
type OpenAIConfigForm = {
|
||||
url: string;
|
||||
key: string;
|
||||
model: string;
|
||||
speaker: string;
|
||||
};
|
||||
|
||||
export const updateAudioConfig = async (token: string, payload: OpenAIConfigForm) => {
|
||||
@@ -95,7 +97,8 @@ export const transcribeAudio = async (token: string, file: File) => {
|
||||
export const synthesizeOpenAISpeech = async (
|
||||
token: string = '',
|
||||
speaker: string = 'alloy',
|
||||
text: string = ''
|
||||
text: string = '',
|
||||
OpenAIModel: string = 'tts-1'
|
||||
) => {
|
||||
let error = null;
|
||||
|
||||
@@ -106,7 +109,7 @@ export const synthesizeOpenAISpeech = async (
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify({
|
||||
model: 'tts-1',
|
||||
model: OpenAIModel,
|
||||
input: text,
|
||||
voice: speaker
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user