Add opt-in speculative input transcription snapshot events
Context
PR #476 aligns conversation.item.input_audio_transcription.delta with the OpenAI Realtime protocol: deltas are append-only newly available text and completed.transcript is the final transcript for the item.
The local progressive STT backends instead produce cumulative hypotheses that may revise earlier words, punctuation, or casing. Standard append-only deltas cannot represent those revisions. Withholding an incompatible hypothesis preserves protocol correctness, but it can leave live transcription visibly stale until completion.
Unknown server event types are not guaranteed to be tolerated by all generated or strictly validated OpenAI clients, so a custom event should not be broadcast to unmodified clients.
Proposal
Add a negotiated speech-to-speech extension for replaceable speculative transcript snapshots.
An opted-in client would receive an event shaped like:
{
"type": "speech_to_speech.input_audio_transcription.snapshot",
"event_id": "event_123",
"item_id": "item_123",
"content_index": 0,
"transcript": "Um I was watching this."
}The extension contract should specify that:
transcriptis the latest cumulative and replaceable hypothesis for that input item.- A later snapshot replaces the earlier snapshot for the same
item_id. - Snapshots are display-only and do not modify conversation history or trigger a response.
- Standard
conversation.item.input_audio_transcription.deltaevents remain append-only. conversation.item.input_audio_transcription.completed.transcriptremains authoritative and clears speculative state.- The server sends snapshot events only after explicit client negotiation, for example through a supported extension value in
session.includeor an equivalent capability mechanism.
Bundled clients can combine both projections:
- append standard deltas into stable transcript state;
- replace speculative display state from snapshots;
- replace everything with
completed.transcriptat completion.
Non-goals
- Encoding corrections inside standard
deltatext. - Sending multiple
completedevents for one item. - Using
content_indexor new item IDs as revision counters. - Changing the append-only stabilizer implemented as part of #476.
Acceptance criteria
- Unmodified clients receive only standard Realtime events.
- Opted-in clients receive cumulative snapshot updates throughout progressive STT.
- Bundled clients display snapshot corrections without duplicating stable delta text.
- Completion replaces the speculative display and releases all per-item snapshot state.
- Overlapping items are reconciled by
item_id. - Negotiation, event schema, client behavior, and cleanup have focused tests and documentation.
Related: #474, #476, #487
Source: huggingface/speech-to-speech