Repository navigation
feat(stt): add VOICEMODE_STT_TRANSLATE for translate-to-English STT - #601
Open
sanketpatel32 wants to merge 1 commit into
Open
sanketpatel32 wants to merge 1 commit into
sanketpatel32 wants to merge 1 commit into
Conversation
…bailey#240) Call each STT endpoint's /v1/audio/translations instead of /v1/audio/transcriptions when VOICEMODE_STT_TRANSLATE=true, so speech in any language comes back as English text (Whisper's translate-to-English task). The translations API has no language parameter -- the source language is auto-detected -- so VOICEMODE_WHISPER_LANGUAGE is not sent while the setting is on. Failover, the local transient-retry loop, and error classification are unchanged; failure entries and OpenAI error parsing now name whichever audio path was called. An endpoint that does not serve translations fails like any other STT error and the chain fails over. Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #240.
What
Adds
VOICEMODE_STT_TRANSLATE(defaultfalse). Whentrue,simple_stt_failovercalls each endpoint's/v1/audio/translationsinstead of/v1/audio/transcriptions, so speech in any language comes back as English text — Whisper's translate-to-English task, exactly the use case in #240 (speak Greek, Claude reads English).# In voicemode.env VOICEMODE_STT_TRANSLATE=trueDetails
VOICEMODE_STT_*family for request-level STT options (VOICEMODE_STT_PROMPT,VOICEMODE_STT_TIMEOUT,VOICEMODE_STT_COMPRESS); theVOICEMODE_WHISPER_*family configures the local whisper.cpp service itself.languageis never sent while translate is on: the translations API has nolanguageparameter (source language auto-detected, output always English), soVOICEMODE_WHISPER_LANGUAGE— explicit orauto— is left out of the request.prompt(VOICEMODE_STT_PROMPT) is still forwarded, since translations accepts it.audio.translations.createinstead ofaudio.transcriptions.create.attempted_endpointsand OpenAI error parsing now record the path that was actually called (/audio/translationsor/audio/transcriptions). An endpoint that doesn't serve translations fails like any other STT error and the chain fails over.Docs
docs/reference/environment.md: new STT table row + a paragraph on behaviour and the droppedlanguageparameter.docs/guides/configuration.md:VOICEMODE_STT_TRANSLATEin the STT example block.voice_mode/resources/docs/parameters.md: new "Translated Speech (STT Translate)" section.voice_mode/resources/configuration.py: listed invoice://config/env-vars; commented sample in the defaultvoicemode.envheader inconfig.py.## [Unreleased] → Added(Support translation endpoint for non-English speech → English output #240).Tests
New
tests/test_stt_translate.py(11 tests): translations endpoint used when on;languageomitted forauto/de/el; prompt/model/response_format still forwarded; transient retry, next-endpoint failover, and endpoint-path reporting all still work; default path untouched. All pass, plus the 72 existing STT failover tests (test_stt_language_auto_fallback,test_stt_error_handling,test_stt_retry,test_stt_timeout,test_stt_failover_wire_model) with no regressions.Co-authored-by: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>