Add Whisper voice transcription to Telegram bot

- handleVoice() downloads Telegram audio and transcribes via Whisper API
- transcribeAudio() calls Whisper with Basic Auth, handles json response
- TelegramWebhookController now routes message.voice and message.audio
- Whisper URL, token and toggle configurable from admin config panel
- Transcribed text echoed back to user then processed as normal text intent

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Lizandro
2026-07-14 19:00:57 +00:00
co-authored by Claude Sonnet 4.6
parent ad9d1761d2
commit f39f3d4045
4 changed files with 111 additions and 0 deletions
@@ -87,6 +87,33 @@
<hr class="border-gray-100">
{{-- Whisper STT --}}
<div>
<h3 class="text-sm font-bold text-gray-700 mb-3">Transcripción de voz (Whisper)</h3>
<p class="text-xs text-gray-400 mb-4">Cuando un usuario envíe un audio en Telegram, se transcribirá con Whisper y el texto pasará al sistema de intención como si lo hubiera escrito.</p>
<div class="space-y-4">
<div>
<label class="block text-sm font-semibold text-gray-700 mb-1">URL del servidor Whisper</label>
<input wire:model.defer="whisper_url" type="text" placeholder="https://whisper.u-s.app/asr"
class="w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:ring-2 focus:ring-emerald-500 outline-none font-mono">
</div>
<div>
<label class="block text-sm font-semibold text-gray-700 mb-1">Token (contraseña Basic Auth)</label>
<input wire:model.defer="whisper_token" type="password" placeholder="Token del servidor Whisper"
class="w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:ring-2 focus:ring-emerald-500 outline-none font-mono">
</div>
<div class="flex items-center gap-3">
<input wire:model.defer="whisper_habilitado" type="checkbox" value="1"
id="whisper_hab" class="w-4 h-4 accent-emerald-600">
<label for="whisper_hab" class="text-sm text-gray-700">
Habilitar transcripción de audios en Telegram
</label>
</div>
</div>
</div>
<hr class="border-gray-100">
{{-- Validacion de pagos --}}
<div>
<h3 class="text-sm font-bold text-gray-700 mb-1">Validacion de pagos por foto + correo IMAP</h3>