Skip to content

fix: add explicit Sarvam WS/REST preference toggles#1057

Merged
toubatbrian merged 3 commits intolivekit:mainfrom
mshivam019:fix/sarvam-rest-preference-followup
Feb 17, 2026
Merged

fix: add explicit Sarvam WS/REST preference toggles#1057
toubatbrian merged 3 commits intolivekit:mainfrom
mshivam019:fix/sarvam-rest-preference-followup

Conversation

@mshivam019
Copy link
Copy Markdown
Contributor

Summary

  • Follow-up to merged Sarvam plugin work in feat: add Sarvam AI STT plugin #1046 (STT) and feat: add Sarvam AI TTS plugin #1038 (TTS): add explicit streaming preference toggles so users can choose WebSocket streaming or prefer REST/non-streaming behavior.
  • Add streaming?: boolean support 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.
  • Update tests to include dummy API key unit coverage for toggle behavior, and make networked integration checks conditional on SARVAM_API_KEY so 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

  • STT:
    • add streaming?: boolean option and propagate it to capabilities
    • preserve the setting during updateOptions
    • guard .stream() when disabled with an actionable error message
  • TTS:
    • add streaming?: boolean option and propagate it to capabilities
    • preserve the setting during updateOptions
    • guard .stream() when disabled with an actionable error message
  • Tests:
    • add explicit non-streaming toggle tests using dummy API keys
    • integration suites run only when SARVAM_API_KEY is present
  • Docs:
    • add STT and TTS usage examples for streaming: false

Verification

  • LSP diagnostics: clean for updated TS files.
  • Targeted tests:
    • pnpm -F @livekit/agents-plugin-sarvam exec vitest run src/stt.test.ts src/tts.test.ts
    • Result: pass with unit tests; integration tests are skipped when SARVAM_API_KEY is absent.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Feb 16, 2026

🦋 Changeset detected

Latest commit: 933f1a6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 20 packages
Name Type
@livekit/agents-plugin-sarvam Patch
@livekit/agents Patch
@livekit/agents-plugin-anam Patch
@livekit/agents-plugin-baseten Patch
@livekit/agents-plugin-bey Patch
@livekit/agents-plugin-cartesia Patch
@livekit/agents-plugin-deepgram Patch
@livekit/agents-plugin-elevenlabs Patch
@livekit/agents-plugin-google Patch
@livekit/agents-plugin-hedra Patch
@livekit/agents-plugin-inworld Patch
@livekit/agents-plugin-lemonslice Patch
@livekit/agents-plugin-livekit Patch
@livekit/agents-plugin-neuphonic Patch
@livekit/agents-plugin-openai Patch
@livekit/agents-plugin-resemble Patch
@livekit/agents-plugin-rime Patch
@livekit/agents-plugin-silero Patch
@livekit/agents-plugin-xai Patch
@livekit/agents-plugins-test Patch

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

@mshivam019 mshivam019 force-pushed the fix/sarvam-rest-preference-followup branch from c48dd7d to 6b5d801 Compare February 16, 2026 08:25
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 4 additional findings.

Open in Devin Review

@mshivam019
Copy link
Copy Markdown
Contributor Author

@toubatbrian this is a follow-up to #1046 and #1038 and closes an API gap in Sarvam STT/TTS: explicit streaming: false preference so users can choose REST over WS in AgentSession. Since the release PR #1049 is already open, could we land this before/with that release so the plugin ships with this toggle?

@mshivam019 mshivam019 mentioned this pull request Feb 16, 2026
@toubatbrian toubatbrian merged commit 659182f into livekit:main Feb 17, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants