Bỏ qua để đến nội dung

Voice local

Local voice mode giúp xử lý voice message riêng tư hơn: Bestie nhận audio từ bất kỳ channel hoặc runtime surface nào nối vào voice pipeline, convert sang WAV khi cần, chạy whisper.cpp, đưa transcript có giới hạn vào agent, rồi xóa raw audio nếu cấu hình yêu cầu.

.bestie/tools/whisper-bin/whisper-cli
.bestie/tools/local-whisper-transcribe.sh
.bestie/models/ggml-small.bin

Dùng lệnh voice top-level vì voice là capability dùng chung, không còn nằm dưới Telegram:

Terminal window
bestie voice setup-local
bestie voice models
bestie voice download-model small
bestie voice download-model small --confirm --use
bestie voice download-model small --confirm --force --use

Tên model hỗ trợ: tiny, small, medium, large-v3-turbo. File đã tồn tại sẽ không bị ghi đè nếu không có --force.

Dùng ElevenLabs khi muốn hosted speech-to-text và speech replies thay vì whisper.cpp local:

Terminal window
bestie voice setup-elevenlabs
bestie doctor --telegram-speech-test

Setup hỏi ElevenLabs API key, voice id, TTS model id, STT model id và output format. Bestie lưu key vào .bestie/.env dưới ELEVENLABS_API_KEY, ghi config transcriptionspeech, rồi bật transcription cho Telegram voice/audio attachments. Với Telegram, speech reply mặc định chỉ gửi voice khi input là voice/audio, giới hạn 800 ký tự và cooldown 30 giây nếu config hiện tại chưa override.

Bestie cũng có Voicebox setup flow local:

Terminal window
bestie voice setup-voicebox

Chạy lệnh và làm theo prompt để cấu hình Voicebox integration local. Sau setup, dùng bestie doctor để kiểm tra các local voice dependency đã cấu hình.

{
"transcription": {
"provider": "local-whisper",
"command": ".bestie/tools/local-whisper-transcribe.sh",
"args": ["{modelPath}", "{audioPath}", "-l", "vi"],
"modelPath": ".bestie/models/ggml-small.bin",
"timeoutMs": 120000
}
}

Với tiếng Việt, ggml-small.bin là baseline thực tế hơn ggml-tiny.bin.

Terminal window
bestie doctor
bestie doctor --telegram-speech-test
bestie channels telegram --once --transcript .bestie/logs/telegram-local-voice-smoke.jsonl

Lệnh Telegram smoke test chỉ kiểm tra adapter Telegram sau khi shared voice đã được cấu hình.

Transcript smoke không được chứa raw message text, transcript text, file ids, paths, owner ids, chat ids, bot token hoặc provider secrets.

Voice hiện là một capability riêng, không còn bị gắn cứng với Telegram. Một Bestie có thể dùng voice từ bất kỳ channel hoặc runtime surface nào có nối audio input/output vào agent.

Điều này nghĩa là Telegram vẫn có thể hỗ trợ workflow voice bằng cách đưa Telegram voice/audio attachments vào shared pipeline, nhưng Telegram không còn là nơi sở hữu feature voice. Hãy xem voice configuration và behavior như capability độc lập, rồi kết nối sang Telegram, CLI, web hoặc adapter tương lai khi cần.