fix: force Spanish in Whisper + clearer voice processing message
- Add language=es to Whisper query params so audio is always transcribed in Spanish regardless of accent or background noise - Show "Procesando..." after echoing the transcript so user knows the AI is interpreting the intent Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
13386f5b49
commit
24b7713c29
@@ -242,7 +242,7 @@ class TelegramBotService
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->send($chatId, "🎙️ Escuché: _\"{$resultado['texto']}\"_");
|
$this->send($chatId, "🎙️ Escuché: _\"{$resultado['texto']}\"_\nProcesando...");
|
||||||
$this->handleText($chatId, $resultado['texto'], $nombre);
|
$this->handleText($chatId, $resultado['texto'], $nombre);
|
||||||
|
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
@@ -262,8 +262,9 @@ class TelegramBotService
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// response_format como query param (algunos servidores no lo leen del form)
|
// response_format y language como query params
|
||||||
$url = rtrim($whisperUrl, '?') . (str_contains($whisperUrl, '?') ? '&' : '?') . 'response_format=json';
|
$sep = str_contains($whisperUrl, '?') ? '&' : '?';
|
||||||
|
$url = rtrim($whisperUrl, '?') . $sep . 'response_format=json&language=es';
|
||||||
|
|
||||||
$response = Http::timeout(60)
|
$response = Http::timeout(60)
|
||||||
->withBasicAuth('whisper', $whisperToken)
|
->withBasicAuth('whisper', $whisperToken)
|
||||||
|
|||||||
Reference in New Issue
Block a user