Skip to content

Add diarize and infer_speaker_names to the realtime speech-to-text wrapper - #945

Merged
JacekDuszenko merged 1 commit into
mainfrom
jacek/scribe-speaker-names
Nov 23, 2026
Merged

JacekDuszenko merged 1 commit into
mainfrom
jacek/scribe-speaker-names

Conversation

@JacekDuszenko

@JacekDuszenko JacekDuszenko commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Combines SDK support for two features - first is realtime diarization - it has a few additional events
second is infer speaker names from diarized transcript

…apper

Adds the diarize and infer_speaker_names options to both realtime
connection modes, sent as boolean query params like no_verbatim, and the
RealtimeEvents.DIARIZED_TRANSCRIPT, SPEAKERS_MERGED and SPEAKER_NAMES
events so the new diarized_transcript, speakers_merged and speaker_names
server messages reach subscribers. The words partial_transcript carries
with diarize need no wiring, as messages reach handlers unchanged.

Also corrects the filter_background_audio docstring: the server now
allows it with include_timestamps and rejects it with diarize.
@JacekDuszenko
JacekDuszenko marked this pull request as ready for review November 23, 2026 10:14
@cursor

cursor Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

PR Summary

Low Risk
Additive API surface and event types with matching tests; no changes to auth or core connection lifecycle.

Overview
Adds speaker diarization and optional speaker name inference to the realtime Scribe client: diarize and infer_speaker_names are new connection options, forwarded as WebSocket query parameters like the other shared STT flags.

When diarization is enabled, callers can listen for diarized_transcript (committed segment text with per-word speaker_id), speakers_merged (when two speaker IDs are collapsed), and speaker_names (full speaker_id → name map updates when name inference is on). Option docs note scribe_v3_live for diarization, that diarize cannot be used with filter_background_audio, and infer_speaker_names requires diarization and cannot be combined with entity_redaction.

Tests cover URL serialization (including explicit false for the new booleans), connect option threading, and message dispatch for the three new event types.

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

@JacekDuszenko
JacekDuszenko merged commit 5e4469e into main Nov 23, 2026
6 checks passed
@JacekDuszenko
JacekDuszenko deleted the jacek/scribe-speaker-names branch November 23, 2026 12:29
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