Repository navigation
Add transcript_edit to the realtime speech-to-text wrapper - #871
Conversation
Adds the transcript_edit option to both realtime connection modes, sent as the transcript_edit query param, and the RealtimeEvents.EDITED_TRANSCRIPT event so the new edited_transcript server message reaches subscribers. Bumps the SDK version to 2.69.0, following the convention of #830.
49e091f to
f3ea731
Compare
PR SummaryLow Risk Overview Introduces Tests extend exhaustive URL/ Reviewed by Cursor Bugbot for commit 782f6af. Bugbot is set up for automated code reviews on this repo. Configure here. |
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Adds the
transcript_editoption toclient.speech_to_text.realtime.connect()(bothRealtimeAudioOptionsandRealtimeUrlOptions) and theRealtimeEvents.EDITED_TRANSCRIPTevent, following the pattern of #830 (entity detection).transcript_edit: str: natural-language instruction applied to each committed transcript (max 2000 characters), sent as thetranscript_editquery param. Cannot be combined withentity_detection; the server rejects the combination withinvalid_request.edited_transcript→RealtimeEvents.EDITED_TRANSCRIPT, carryingtext(the committed text the instruction was applied to) andedited_text(identical totextif no edits were made). Edits run asynchronously and may arrive out of commit order, sotextis the field to correlate on. Dispatch is by enum value, so adding the member is what routes the message.transcript_edit; dispatch tests cover the new event.pyproject.toml,client_wrapperheaders), as Add missing realtime speech-to-text options #830 did. Happy to drop that if releases are cut differently now.Upstream: the parameter and event ship in elevenlabs/xi#49618 (websocket route) and elevenlabs/xi#51266 (public AsyncAPI spec); docs in elevenlabs/elevenlabs-dx#2778; JS counterpart in elevenlabs/elevenlabs-js (same branch name); client SDK in elevenlabs/packages#1023. Pricing: 30% premium on the base transcription cost, billed for at least 10 seconds of audio per committed transcript.
Verified locally:
ruff checkclean,mypy src/elevenlabs/realtimeclean,pytest tests/test_stt_realtime.py33 passed.🤖 Generated with Claude Code