Skip to content

Add entity_redaction to the realtime speech-to-text wrapper - #912

Merged
JacekDuszenko merged 1 commit into
mainfrom
jacek/scribe-entity-redaction
Nov 2, 2026
Merged

JacekDuszenko merged 1 commit into
mainfrom
jacek/scribe-entity-redaction

Conversation

@JacekDuszenko

Copy link
Copy Markdown
Contributor

No description provided.

Adds the entity_redaction and entity_redaction_mode options to both realtime
connection modes, sent as query params (entity_redaction repeated per entity,
like entity_detection), and the RealtimeEvents.REDACTED_TRANSCRIPT event so
the new redacted_transcript server message reaches subscribers.
@JacekDuszenko
JacekDuszenko marked this pull request as ready for review October 30, 2026 19:35
@cursor

cursor Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

PR Summary

Low Risk
Additive, backward-compatible SDK surface with tests; no changes to authentication or existing event behavior beyond the new redaction event and query params.

Overview
Adds entity redaction support to the realtime Scribe wrapper so callers can request redacted committed transcripts via new connect options entity_redaction (same shape as entity detection) and optional entity_redaction_mode (redacted, entity_type, or enumerated_entity_type).

Those options are forwarded as WebSocket query parameters and documented as mutually exclusive with transcript_edit (docs updated accordingly). A new RealtimeEvents.REDACTED_TRANSCRIPT event is wired through the connection dispatcher; payloads can include both original text and redacted_text. RealtimeEntityRedactionMode is exported from the public realtime package.

Tests cover URL serialization (including a bare string for entity_redaction), connect option plumbing, and event dispatch for redacted_transcript.

Reviewed by Cursor Bugbot for commit 0299024. Bugbot is set up for automated code reviews on this repo. Configure here.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

There are no active review issues for the realtime speech-to-text entity-redaction changes.

No open issues 🎉

What changed in this PR

Adds entity redaction support to the realtime speech-to-text wrapper, allowing callers to configure redaction and receive redacted transcripts separately from unredacted transcript events.

Changes:

  • Adds typed redaction options and serializes them into WebSocket query parameters.
  • Exposes the redaction mode type and REDACTED_TRANSCRIPT event.
  • Extends tests for option forwarding, serialization, and redacted event delivery.
File Description
tests/​test_stt_realtime.py Tests redaction parameters and event payload delivery.
src/​elevenlabs/​realtime/​scribe.py Defines, documents, and forwards redaction options.
src/​elevenlabs/​realtime/​connection.py Adds the redacted transcript event constant.
src/​elevenlabs/​realtime/​__init__.py Exports the redaction mode type.

Review effort: Balanced

@JacekDuszenko
JacekDuszenko merged commit 5f3cf2e into main Nov 2, 2026
7 checks passed
@JacekDuszenko
JacekDuszenko deleted the jacek/scribe-entity-redaction branch November 2, 2026 16:14
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.

3 participants