v10: TTS/STT axios fixes, better error logging, stop button

- TTS: switch to axios, drop voice param (configured in LiteLLM per model)
- STT: log full LiteLLM error body so 500s are diagnosable in logs
- TTS: same error detail logging
- Fix 'ElevenLabs unavailable' toast to generic 'TTS unavailable'
- Add red Stop button to encounter recording UI
This commit is contained in:
Daniel Onyejesi 2026-03-29 22:12:02 -04:00
parent e6091c299f
commit e2e7943dcb
2 changed files with 11 additions and 4 deletions

View file

@ -105,8 +105,12 @@ router.post('/transcribe', authMiddleware, upload.single('audio'), async (req, r
console.log('[Transcribe] Whisper done in ' + (Date.now() - startTime) + 'ms');
res.json({ success: true, text: text, provider: 'openai-whisper', duration: Date.now() - startTime });
} catch (err) {
console.error('[Transcribe] Error:', err.message);
res.status(500).json({ error: err.message });
// Log full LiteLLM/upstream error body so we can diagnose
var detail = err.response && err.response.data
? JSON.stringify(err.response.data).substring(0, 500)
: err.message;
console.error('[Transcribe] Error (' + provider + '):', detail);
res.status(500).json({ error: detail });
}
});

View file

@ -60,8 +60,11 @@ router.post('/text-to-speech', authMiddleware, async (req, res) => {
res.status(400).json({ error: 'TTS not configured. Set LITELLM_API_BASE or ELEVENLABS_API_KEY.' });
} catch (err) {
console.error('[TTS] Error:', err.message);
res.status(500).json({ error: 'TTS failed: ' + err.message });
var detail = err.response && err.response.data
? JSON.stringify(err.response.data).substring(0, 500)
: err.message;
console.error('[TTS] Error (' + ttsProvider + '):', detail);
res.status(500).json({ error: 'TTS failed: ' + detail });
}
});