Update route.js

This commit is contained in:
suraj.shenoy.b@gmail.com
2025-01-25 21:09:55 -06:00
parent be4c520d4a
commit 1f5c11b999

View File

@@ -81,10 +81,9 @@ export async function POST(req, res) {
// Step 2: Get transcription from OpenAI Whisper model // Step 2: Get transcription from OpenAI Whisper model
console.log('Requesting transcription...'); console.log('Requesting transcription...');
const transcription = await openaiClient.audio.transcriptions.create({ const transcription = await openai.audio.translations.create({
file: audio_file, file: fs.createReadStream(audio_file),
model: 'whisper-1', model: "whisper-1",
response_format: 'text',
}); });
// Clean up temporary file // Clean up temporary file