Fix LiteLLM STT: remove prompt/response_format unsupported by Vertex Chirp
Vertex AI Chirp via LiteLLM rejects/hangs when 'prompt' and 'response_format' are included — these are OpenAI Whisper-only params. Send only file + model for LiteLLM/Chirp.
This commit is contained in:
parent
c59f9c9ca3
commit
6a8e7e5f33
1 changed files with 2 additions and 3 deletions
|
|
@ -79,9 +79,8 @@ router.post('/transcribe', authMiddleware, upload.single('audio'), async (req, r
|
|||
contentType: req.file.mimetype || 'audio/webm'
|
||||
});
|
||||
form.append('model', sttModel);
|
||||
form.append('language', 'en');
|
||||
form.append('response_format', 'json');
|
||||
form.append('prompt', 'Medical patient encounter. Pediatric. Clinical terms, diagnoses, medications.');
|
||||
// Note: Vertex AI Chirp via LiteLLM does not support 'prompt' or 'response_format'
|
||||
// Only send parameters Chirp actually accepts
|
||||
var sttHeaders = Object.assign({}, form.getHeaders());
|
||||
if (process.env.LITELLM_API_KEY) sttHeaders['Authorization'] = 'Bearer ' + process.env.LITELLM_API_KEY;
|
||||
var base = process.env.LITELLM_API_BASE.replace(/\/+$/, '');
|
||||
|
|
|
|||
Loading…
Reference in a new issue