fix: add explicit Sarvam WS/REST preference toggles#1057
Merged
toubatbrian merged 3 commits intolivekit:mainfrom Feb 17, 2026
Merged
fix: add explicit Sarvam WS/REST preference toggles#1057toubatbrian merged 3 commits intolivekit:mainfrom
toubatbrian merged 3 commits intolivekit:mainfrom
Conversation
🦋 Changeset detectedLatest commit: 933f1a6 The changes in this PR will be included in the next version bump. This PR includes changesets to release 20 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
c48dd7d to
6b5d801
Compare
Contributor
Author
|
@toubatbrian this is a follow-up to #1046 and #1038 and closes an API gap in Sarvam STT/TTS: explicit |
Merged
toubatbrian
approved these changes
Feb 17, 2026
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.
Summary
streamingpreference toggles so users can choose WebSocket streaming or prefer REST/non-streaming behavior.streaming?: booleansupport to both Sarvam STT and TTS, defaulting to current behavior (true), and fail fast with clear errors if.stream()is called while streaming is disabled.SARVAM_API_KEYso local verification works without secrets.Why this is required
The original STT/TTS feature PRs established working WS and REST code paths, but they did not expose an explicit user-facing switch to prefer REST over WS when desired. In
AgentSession, providers that advertise streaming are routed through.stream(); without a toggle users cannot opt into REST-first behavior even though those REST implementations already exist. This PR closes that gap with backwards-compatible defaults.Changes
streaming?: booleanoption and propagate it to capabilitiesupdateOptions.stream()when disabled with an actionable error messagestreaming?: booleanoption and propagate it to capabilitiesupdateOptions.stream()when disabled with an actionable error messageSARVAM_API_KEYis presentstreaming: falseVerification
pnpm -F @livekit/agents-plugin-sarvam exec vitest run src/stt.test.ts src/tts.test.tsSARVAM_API_KEYis absent.