feat(stt): add Yandex SpeechKit STT provider - #23995
Closed
ibaldr89 wants to merge 1 commit into
Closed
Conversation
Add Yandex SpeechKit Sync API as a seventh STT provider.
Features:
- Raw binary upload to POST stt.api.cloud.yandex.net/speech/v1/stt:recognize
- Native OGG/Opus support (Telegram and WhatsApp default voice format)
- WAV/PCM support with sample-rate validation (8000/16000/48000 Hz)
- Automatic stereo-to-mono downmix via ffmpeg when needed
- File size guard (1 MB hard limit) and duration guard (30s hard limit)
- Helper functions: _get_audio_duration_seconds(), _get_audio_channels(),
_ensure_mono_for_yandex() — each degrades gracefully when ffprobe/ffmpeg
is not installed
- Language, topic, folder_id, profanity_filter, raw_results config options
- Full integration: explicit config + auto-detect (lowest priority, after xAI)
Config (config.yaml):
stt:
provider: yandex
yandex:
language: ru-RU # BCP-47 language code (default: ru-RU)
topic: general # general | general:rc | general:deprecated
folder_id: "" # Yandex Cloud folder ID (optional)
profanity_filter: false # Filter profanity (default: false)
raw_results: false # numbers as words (true) or digits (false)
Requires YANDEX_API_KEY environment variable.
Auto-detect priority: local > groq > openai > mistral > xai > yandex > none
5 tasks
Contributor
|
Thanks for the thorough implementation and focused test coverage. This automated hermes-sweeper review is closing this under the standing
Closed as not-planned per standing maintainer policy ( |
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.
What does this PR do?
Adds Yandex SpeechKit Sync API as a seventh STT provider. Yandex SpeechKit
has best-in-class Russian speech recognition accuracy (~97% WER). It natively
accepts OGG/Opus, which is the default voice format sent by Telegram and
WhatsApp — meaning no re-encoding is needed for the most common gateway use case.
The provider slots into the existing STT abstraction with zero changes to
callers. It lives entirely within
tools/transcription_tools.py.Related Issue
N/A
Type of Change
Changes Made
tools/transcription_tools.py—_transcribe_yandex()provider function;three helper functions (
_get_audio_duration_seconds,_get_audio_channels,_ensure_mono_for_yandex); wired into_get_provider()explicit check andauto-detect fallback chain; added to
transcribe_audio()dispatchertests/tools/test_transcription_tools.py— 22 new unit tests covering theprovider function, helper functions, dispatcher integration, and auto-detect
logic; also adds the missing
XAI_API_KEYdelenv to theclean_envfixturecli-config.yaml.example— documents thestt.yandexconfig sub-sectionand updates the provider list comment (which was missing xAI too)
How to Test
YANDEX_API_KEY=<your key>in~/.hermes/.envYandex SpeechKit automatically (auto-detect picks Yandex when no local
faster-whisper is installed)
stt: { provider: yandex }to~/.hermes/config.yamlpytest tests/tools/test_transcription_tools.py -v -k "Yandex or yandex or EnsureMono or AudioChannel or AudioDuration"Expected: all 22 new tests pass without a real API key (all HTTP calls are mocked).
Checklist
Code
feat(stt):)pytest tests/ -qand all tests passDocumentation & Housekeeping
cli-config.yaml.examplewith the newstt.yandexconfig keysopen()calls use binary mode;subprocess.runuses list form withcheck=False; no POSIX-only signals or file modes used