fix: /api/health/detailed reported a text-to-speech provider that does not exist
The endpoint answered from environment variables of its own rather than from the speech code, so ELEVENLABS_API_KEY being set made it report tts: 'elevenlabs'. There is no ElevenLabs path in ttsProvider.js — getTTSProvider() only ever returns 'litellm' or 'none' — so the one endpoint an operator checks to find out what speech is doing was reporting a provider this app cannot use. Likewise whisper: OPENAI_API_KEY, which stopped describing STT when transcription moved behind the gateway. Both now ask getSTTProvider() and getTTSProvider(), the same functions the routes ask, so the answer cannot drift from behaviour again. Removed the two other ElevenLabs leftovers: the FAQ told users their notes were read aloud by "Google, OpenAI, or ElevenLabs", and a TTS test used 'elevenlabs' as its sample value for the passthrough of TTS_PROVIDER, which implied the provider was supported. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Dv6sqaY6Vq3ChZHMem3cnU
This commit is contained in:
parent
67e416c6d9
commit
cfb8aab77d
3 changed files with 9 additions and 5 deletions
|
|
@ -124,7 +124,7 @@
|
|||
<div class="faq-item">
|
||||
<button class="faq-question">Can the AI read my notes aloud?</button>
|
||||
<div class="faq-answer">
|
||||
<p>Yes. Click the <strong>Read</strong> button on any generated note to hear it spoken aloud. This uses text-to-speech (TTS) powered by Google, OpenAI, or ElevenLabs depending on your setup. You can choose your preferred voice in <strong>Settings > Voice Preferences</strong>.</p>
|
||||
<p>Yes. Click the <strong>Read</strong> button on any generated note to hear it spoken aloud. Which voice engine does the speaking depends on what your administrator has configured. You can choose your preferred voice in <strong>Settings > Voice Preferences</strong>.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -308,8 +308,12 @@ app.get('/api/health/detailed', _hcAuth, _hcAdmin, (req, res) => {
|
|||
bedrock: process.env.AWS_BEDROCK_REGION ? 'configured' : 'not configured',
|
||||
azure: process.env.AZURE_OPENAI_ENDPOINT ? 'configured' : 'not configured',
|
||||
litellm: process.env.LITELLM_API_BASE ? 'configured' : 'not configured',
|
||||
whisper: process.env.OPENAI_API_KEY ? 'configured' : 'missing',
|
||||
tts: process.env.LITELLM_API_BASE ? 'litellm' : (process.env.ELEVENLABS_API_KEY ? 'elevenlabs' : 'none')
|
||||
// Asked of the same functions the routes ask, so this cannot drift from what
|
||||
// speech actually does. It used to answer from environment variables of its
|
||||
// own and would report tts: 'elevenlabs' for a provider that does not exist
|
||||
// in this app — a health check that lies is worse than one that is absent.
|
||||
stt: require('./src/utils/sttProvider').getSTTProvider(),
|
||||
tts: require('./src/utils/ttsProvider').getTTSProvider()
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -27,8 +27,8 @@ test('TTS provider defaults to LiteLLM when gateway is configured', () => {
|
|||
|
||||
test('TTS provider ignores non-LiteLLM provider overrides', () => {
|
||||
const ttsProvider = require('../src/utils/ttsProvider');
|
||||
withEnv({ TTS_PROVIDER: 'elevenlabs', LITELLM_API_BASE: 'https://llm.example.com' }, () => {
|
||||
assert.equal(ttsProvider.getTTSEnvProvider(), 'elevenlabs');
|
||||
withEnv({ TTS_PROVIDER: 'some-other-provider', LITELLM_API_BASE: 'https://llm.example.com' }, () => {
|
||||
assert.equal(ttsProvider.getTTSEnvProvider(), 'some-other-provider');
|
||||
assert.equal(ttsProvider.getTTSProvider(), 'litellm');
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue