Skip to content

feat(elevenlabs): support previous_text on realtime STT - #6534

Merged
longcw merged 2 commits into
livekit:mainfrom
tulanisahil1-beep:feat/elevenlabs-stt-previous-text
Jul 27, 2026
Merged

feat(elevenlabs): support previous_text on realtime STT#6534
longcw merged 2 commits into
livekit:mainfrom
tulanisahil1-beep:feat/elevenlabs-stt-previous-text

Conversation

@tulanisahil1-beep

@tulanisahil1-beep tulanisahil1-beep commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

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

@tulanisahil1-beep
tulanisahil1-beep requested a review from a team as a code owner July 24, 2026 06:16
@CLAassistant

CLAassistant commented Jul 24, 2026

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ tulanisahil1-beep
❌ sahiltulanibluebash


sahiltulanibluebash seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@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

@tulanisahil1-beep
tulanisahil1-beep force-pushed the feat/elevenlabs-stt-previous-text branch 3 times, most recently from 3426887 to 4dcc7dd Compare July 24, 2026 18:00
@tulanisahil1-beep
tulanisahil1-beep force-pushed the feat/elevenlabs-stt-previous-text branch from 4dcc7dd to 54feb45 Compare July 24, 2026 18:00
keyterms=keyterms,
no_verbatim=no_verbatim if is_given(no_verbatim) else False,
enable_logging=enable_logging,
previous_text=previous_text if is_given(previous_text) else None,

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.

should we add a warning and ignore it when it's set for other models than the scribe v2 realtime?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good call — done. We now warn and ignore previous_text when it's set on models other than scribe_v2_realtime, matching the server_vad pattern.

@longcw
longcw merged commit 66f4b7e into livekit:main Jul 27, 2026
15 of 16 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.

feat(elevenlabs): support previous_text context on STT realtime input chunks

3 participants