Skip to content

feat(streaming): add speakerLabelsRevisionIntervalMs param - #188

Merged
dlange-aai merged 3 commits into
mainfrom
dlange/speaker-labels-revision-interval
Sep 24, 2026
Merged

dlange-aai merged 3 commits into
mainfrom
dlange/speaker-labels-revision-interval

Conversation

@dlange-aai

@dlange-aai dlange-aai commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds speakerLabelsRevisionIntervalMs to StreamingTranscriberParams, sent as the speaker_labels_revision_interval_ms query param. That is the canonical GA name since DeepLearning#20528; the server still accepts the _-prefixed spelling as a legacy alias, but the SDK sends the GA form.

client.streaming.transcriber({
  speechModel: "universal-3-5-pro",
  sampleRate: 16_000,
  speakerLabels: true,
  speakerLabelsRevisionIntervalMs: 120_000,
});

How the server treats it (from ConnectionParameters in the realtime api_v2 gateway):

  • It sets how often, in ms of audio time, the server emits mid-stream speakerRevision events. Unset or 0 gives only the end-of-stream revision; 0 is sent explicitly rather than dropped.
  • Non-zero values are clamped server-side to 120 000–300 000 ms. The server rejects values below 0 or above 86 400 000 at connect. The SDK has no client-side range check, consistent with maxSpeakers.
  • Only used when speakerLabels is enabled.
  • The first mid-stream revision needs ~120 s of streamed speech, and a revision is sent only when some earlier turn's label changed.

Version bumped to 4.41.5 with a changelog entry, and the CLAUDE.md speaker-revisions section is updated.

Test plan

  • Unit tests: the connection URL includes speaker_labels_revision_interval_ms=120000, and =0 when explicitly set to 0
  • eslint, tsc and prettier are clean
  • Live on prod (main diarization lane), GA param name: two parallel 240 s real-time sessions over the same audio
arm mid-stream revisions end-of-stream
speakerLabelsRevisionIntervalMs: 120_000 1 (at 122.7 s) 1
unset (control) 0 1

(An earlier run using the legacy _-prefixed name and a 60 000 value showed the same pattern, with its mid-stream revision at 126.3 s. The server clamps 60 000 up to 120 000.)

Note: tests/unit/utils.test.ts has 3 failures on Node 24 that also occur on clean main. They expect a runtime_env segment in the user-agent string, and are unrelated to this change.

🤖 Generated with Claude Code

dlange-aai and others added 2 commits September 23, 2026 15:07
Add `speakerLabelsRevisionIntervalMs` to `StreamingTranscriberParams`,
sent as the underscore-prefixed `_speaker_labels_revision_interval_ms`
query param (the server's not-yet-GA wire name). It sets the cadence, in
ms of audio time, at which the server emits mid-stream `speakerRevision`
events when `speakerLabels` is enabled; unset or 0 sends only the
end-of-stream revision, and values above the server default (300 000 ms)
are clamped. `0` is sent explicitly rather than dropped.

Bump version to 4.41.5 and add the changelog entry.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Verified live on prod: with speakerLabelsRevisionIntervalMs=60000 over 240 s
of audio the first mid-stream speakerRevision arrived at 126 s (the server's
120 s min-content floor); the unset control got only the end-of-stream one.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The server made the un-prefixed name canonical in DeepLearning#20528 (the
`_`-prefixed spelling is now a legacy alias), and non-zero values are
clamped server-side to 120 000–300 000 ms. Send the GA name, drop the
"not officially supported" wording, document the clamp, and use 120 000
in the tests. Verified live on prod: interval=120000 got a mid-stream
speakerRevision at 122.7 s; the unset control got only the final one.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@dlange-aai
dlange-aai merged commit 73ee376 into main Sep 24, 2026
4 checks passed
@dlange-aai
dlange-aai deleted the dlange/speaker-labels-revision-interval branch September 24, 2026 15:58
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