add more params

This commit is contained in:
Henry
2024-02-02 20:07:50 +00:00
parent a4131dc21b
commit 041bfea940
2 changed files with 43 additions and 1 deletions
+4 -1
View File
@@ -21,7 +21,10 @@ export const convertSpeechToText = async (upload: IFileUpload, speechToTextConfi
const transcription = await openAIClient.audio.transcriptions.create({
file: audio_file,
model: 'whisper-1'
model: 'whisper-1',
language: speechToTextConfig?.language,
temperature: speechToTextConfig?.temperature ? parseFloat(speechToTextConfig.temperature) : undefined,
prompt: speechToTextConfig?.prompt
})
if (transcription?.text) {
return transcription.text