You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(tools): transcribe — native audio transcription via whisper.cpp
transcribe tool (cmd/odek/transcribe_tool.go):
- Takes audio file path, returns structured {text, duration_sec,
segments, model, language}
- Calls whisper CLI as subprocess with --output-json flag
- Parses whisper's JSON output into typed Go structs
- Validates binary on PATH (whisper or whisper-cli) with clear
setup instructions when missing
- Validates model file at ~/.odek/whisper/models/ggml-<model>.bin
with clear download instructions when missing
- NO implicit downloads — errors tell the user exactly what to do
- Same security as all tools: danger.ClassifyPath + O_NOFOLLOW
- Registered in builtinTools() + classifyToolCall() + recover()
Config (internal/config/loader.go):
- New TranscriptionConfig type: Model, Language, AutoTranscribe,
ModelsDir, BinaryPath
- Added to FileConfig JSON schema (transcription section in odek.json)
- Added to ResolvedConfig with resolveTranscription defaults
- Default: model=tiny, auto_transcribe=true
Telegram auto-transcribe (cmd/odek/telegram.go):
- OnVoiceMessage now auto-transcribes when AutoTranscribe=true
- Transcribed text injected directly as user message (seamless)
- Falls back to sending the file path if transcription fails
- No more 'use shell tools to transcribe' — it just works
Tests: 7 tests covering missing binary, missing model, file not found,
empty path, invalid JSON, symlink rejection, and full mock whisper
happy path with parsed JSON response. 0 new dependencies.
0 commit comments