Repository navigation
feat(voice): add Sarvam AI (Saaras v4) speech-to-text provider - #496
Merged
Merged
Conversation
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.
Closes #495.
Summary
Adds Sarvam AI (
saaras:v4, fallbacksaaras:v3) as a speech-to-text provider in Settings > Voice for both desktop and mobile dictation.Changes
electron/voice-catalog.mjs&electron/voice-catalog.d.mts:sarvam(Sarvam AI) inVOICE_PROVIDERSandVOICE_PROVIDER_INFOwith default modelsaaras:v4(andsaaras:v3),key: "required", andkeyUrl: "https://dashboard.sarvam.ai/key-management".voiceInputKeyson desktop, Keychain/Keystore on mobile) and Settings > Voice UI rows via the shared catalog.electron/voice-providers.mjs:transcribeClip: posts WAVmultipart/form-datatohttps://api.sarvam.ai/speech-to-textwith headerapi-subscription-key,model,mode: "transcribe", andlanguage_code, readingbody.transcript.sarvamLanguage(tag)to normalize BCP-47 tags to Sarvam's supported*-INlanguage codes (en-*->en-IN,or-*->od-IN, supported Indic languages -><lang>-IN) and fall back tounknown(auto-detect) when unset or outside Sarvam's supported set.electron/voice-providers.node-test.mjs.electron/voice-input-main.node-test.mjs(voiceKeyStatusandsessionOptionsforsarvam/saaras:v4) andsrc/lib/voice-input/voice-input.test.ts(resolveEngine,providerReady,providerRunsOn).Intentionally left out
server/tts/listen.ts,server/config.ts,key-catalog.ts): Left out to keep this PR small and focused on Settings > Voice dictation without adding untranslated Vault locale keys.wss://api.sarvam.ai/speech-to-text/ws): Uses the existing piece-based batch session (realtime: false) for now.Verification
pnpm lint(0 warnings, 0 errors)pnpm typechecknode --test electron/voice-providers.node-test.mjs electron/voice-input-main.node-test.mjs(38/38 passed)pnpm exec vitest run src/lib/voice-input/ scripts/testing/file-size-ratchet.test.ts(6 files, 37/37 passed)