Skip to content

feat(elevenlabs): support previous text for realtime STT - #2129

Open
rosetta-livekit-bot[bot] wants to merge 1 commit into
mainfrom
port-elevenlabs-stt-previous-text
Open

feat(elevenlabs): support previous text for realtime STT#2129
rosetta-livekit-bot[bot] wants to merge 1 commit into
mainfrom
port-elevenlabs-stt-previous-text

Conversation

@rosetta-livekit-bot

@rosetta-livekit-bot rosetta-livekit-bot Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add previousText to ElevenLabs STT options, keeping it for scribe_v2_realtime and warning/ignoring it for non-realtime models.
  • Send previous_text once as the first realtime input_audio_chunk on websocket connections.
  • Add adapted source parity tests and a changeset for @livekit/agents-plugin-elevenlabs.

Source diff coverage

Coverage classification
  • livekit-plugins/livekit-plugins-elevenlabs/livekit/plugins/elevenlabs/stt.py: ported to plugins/elevenlabs/src/stt.ts. Python previous_text maps to JS previousText; constructor warning/ignore behavior maps directly; realtime websocket sends an initial empty input_audio_chunk with previous_text before any audio/keepalive task.
  • tests/test_plugin_elevenlabs_stt.py: adapted to plugins/elevenlabs/src/stt.test.ts. JS private fields prevent direct _opts assertions, so the realtime retention assertion is adapted to observe the first websocket message; the non-realtime ignore/warning assertion is ported by spying on the package logger.

Testing

  • pnpm test plugins/elevenlabs/src/stt.test.ts
  • pnpm --filter @livekit/agents-plugin-elevenlabs build
  • pnpm --filter @livekit/agents-plugin-elevenlabs lint
  • pnpm test plugins/elevenlabs
  • pnpm build
  • pnpm lint (passes with existing warnings)
  • pnpm --filter @livekit/agents-plugin-elevenlabs api:check (fails because this package has no checked-in API report, with existing missing release-tag warnings)

Ported from livekit/agents#6534

Original PR description

Summary

  • Add previous_text to ElevenLabs realtime STT (scribe_v2_realtime)
  • After each WebSocket connect (including reconnect), send it on a priming empty input_audio_chunk so it is always the first chunk on the connection (ElevenLabs requires this)

Fixes #6074

Test plan

  • uv run pytest tests/test_plugin_elevenlabs_stt.py --plugin elevenlabs

@rosetta-livekit-bot
rosetta-livekit-bot Bot requested a review from a team as a code owner July 27, 2026 08:52
@changeset-bot

changeset-bot Bot commented Jul 27, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: e9ce1fa

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

This PR includes changesets to release 39 packages
Name Type
@livekit/agents-plugin-elevenlabs Major
@livekit/agents Major
@livekit/agents-plugin-anam Major
@livekit/agents-plugin-anthropic Major
@livekit/agents-plugin-assemblyai Major
@livekit/agents-plugin-azure Major
@livekit/agents-plugin-baseten Major
@livekit/agents-plugin-bey Major
@livekit/agents-plugin-cartesia Major
@livekit/agents-plugin-cerebras Major
@livekit/agents-plugin-deepgram Major
@livekit/agents-plugin-did Major
@livekit/agents-plugin-fishaudio Major
@livekit/agents-plugin-google Major
@livekit/agents-plugin-hedra Major
@livekit/agents-plugin-hume Major
@livekit/agents-plugin-inworld Major
@livekit/agents-plugin-krisp Major
@livekit/agents-plugin-lemonslice Major
@livekit/agents-plugin-liveavatar Major
@livekit/agents-plugin-livekit Major
@livekit/agents-plugin-minimax Major
@livekit/agents-plugin-mistral Major
@livekit/agents-plugin-mistralai Major
@livekit/agents-plugin-neuphonic Major
@livekit/agents-plugin-openai Major
@livekit/agents-plugin-perplexity Major
@livekit/agents-plugin-phonic Major
@livekit/agents-plugin-protoface Major
@livekit/agents-plugin-resemble Major
@livekit/agents-plugin-rime Major
@livekit/agents-plugin-runway Major
@livekit/agents-plugin-sarvam Major
@livekit/agents-plugin-silero Major
@livekit/agents-plugin-soniox Major
@livekit/agents-plugin-tavus Major
@livekit/agents-plugin-trugen Major
@livekit/agents-plugin-xai Major
@livekit/agents-plugins-test Major

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

@rosetta-livekit-bot
rosetta-livekit-bot Bot requested a review from longcw July 27, 2026 08:52

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

Copy link
Copy Markdown
Contributor

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 1 additional finding.

Open in Devin Review

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.

0 participants