Repository navigation
Conversation
A backend that types partials can append to them (Partial) or correct them while committing the segment (Replace). A provider that keeps refining its in-progress hypothesis also needs to correct the typed tail without ending the segment. Add StreamingEvent::RevisePartial and StreamingSession::revise_partial. A revision backspaces at most the current partial, so it can never erase finalized text, then types the corrected suffix. A revision that cannot be applied, or whose text a clipboard driver took instead of the cursor, ends the session with an error, because the backend's next revision is relative to text the cursor does not show. File output and a disowned typing surface apply the same edit to the buffered text. Text a clipboard driver took instead of the cursor is no longer counted as typed, so a later cleanup rewrite, correction or cancel cannot BackSpace over text that was there before. A partial delta that falls back to the clipboard still joins the transcript in order; a final whose correction reaches it fixes the transcript and only appends at the cursor, while a correction of text typed after it still BackSpaces that text. No backend emits the event yet; the ElevenLabs engine does.
Add engine = "elevenlabs" behind the elevenlabs Cargo feature. It uploads the finished recording to the ElevenLabs speech-to-text API as 16 kHz PCM, with a data-residency region, an optional language hint and the provider's disfluency cleanup (no_verbatim). The model is [elevenlabs] model, --elevenlabs-model or VOXTYPE_ELEVENLABS_MODEL, default scribe_v3. It goes to the API as given, like whisper's remote_model, so a new model works without a voxtype release. The API key comes from [elevenlabs] api_key or ELEVENLABS_API_KEY. It travels only in a sensitive request header and is redacted from provider error messages. The [elevenlabs] section, the --elevenlabs-* flags and the VOXTYPE_ELEVENLABS_* variables also carry the realtime settings (mode, commit_strategy, vad_silence_threshold_secs). mode defaults to batch here. The realtime modes take effect in the next commit; until then every mode transcribes the finished recording.
mode = "realtime", now the default, streams audio to the Scribe realtime WebSocket and types committed segments. mode = "partials" also types the provisional transcript and revises it with RevisePartial as the provider refines it. commit_strategy chooses provider VAD commits or a single explicit commit when recording stops. The model is [elevenlabs] realtime_model, --elevenlabs-realtime-model or VOXTYPE_ELEVENLABS_REALTIME_MODEL, default scribe_v3_live, passed through as given. The provider sends each committed segment without a leading space. voxtype puts one in front of a segment where a script that separates words with spaces continues with a word, so English joins as "Hello. World" while Japanese, Chinese and Thai join with none. The script of the earlier text is read from its last letter or digit, so trailing punctuation does not hide it. The rule depends only on the committed text and the segment, so a partial and its commit agree. The daemon treats the engine differently from other streaming backends in five places. Each is gated on the engine, so other backends keep their behavior: - Every stop keeps the typing surface attached. The explicit final commit arrives after the microphone closes and is drained within a bounded time, so the last phrase is typed in place instead of dropped. The user may switch windows meanwhile, so from the stop on the session only appends: no BackSpace, and a cancel during the drain does not rewind. A final that extends the text typed before the stop adds the rest. One that corrects it leaves the typed text alone and logs the dropped correction, and a partial with no final after it is typed when the session ends. File output keeps its bookkeeping. - In partials mode a partial that cannot be typed at the cursor, such as one a clipboard fallback took, ends the session with an error that points to realtime mode. The provider's next revision is relative to text the cursor does not show. - Push-to-talk is not promoted to toggle when the built-in evdev listener is in use: it sees the physical key release no matter what synthetic typing does to the compositor's held-key state. - Recording start rejects output settings that per-update typing cannot honor (non-type output modes, a profile's included, auto_submit, append_text, output hooks, post-processing) and points to batch mode. - A failed session recovers its audio with Whisper first, as Soniox does. The drain after the stop's commit is a small state machine: awaiting the final, final confirmed, or speech outstanding. The protocol does not say which commit a committed transcript answers, so a VAD commit still in flight can answer before the stop's commit. A partial after a final that says the same words, ignoring case, punctuation and spacing, is an echo. Any other partial is speech the stop's commit covers, and the drain waits for its final. Speech still outstanding at the 10 s bound fails the session rather than ending it cleanly. With nothing typed, the existing streaming recovery transcribes the audio. Once text is typed, recovery would repeat it, so the last partial is appended unconfirmed instead. A final counts as confirmed only once the daemon has received it, so one it never gets fails the drain too. A confirmed final ends the drain after 1 s of quiet, or 3 s when VAD commits were on and speech was open at the stop. The API key is redacted from provider errors and from errors about malformed realtime messages, which can quote the message.
Add the [elevenlabs] configuration reference, a user manual section, troubleshooting entries, and a manual smoke test for the live cleanup workflow: manual commit, provider cleanup, partial revision, correction drivers and failure handling. Closes peteonrails#545
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Voxtype can't dictate with ElevenLabs Scribe, and its cloud streaming engines only type committed text. This adds
engine = "elevenlabs"behind theelevenlabsCargo feature. It is aStreamingTranscriberpeer to Soniox with its own[elevenlabs]section, as discussed in #545.There are three modes:
mode = "batch": works like the other cloud engines. Nothing is typed while you speak. When you stop, the whole recording is uploaded and the transcript is typed in one go. Default modelscribe_v3.mode = "realtime", the default: audio streams to ElevenLabs while you speak. Each time you pause, ElevenLabs commits that phrase and Voxtype types it, so text appears phrase by phrase during dictation. Committed text is never changed afterwards. Default modelscribe_v3_live.mode = "partials": like realtime, but Voxtype also types ElevenLabs' running guess before a phrase is committed, so words appear as you say them. When ElevenLabs corrects its guess, Voxtype erases the changed words with BackSpace and types the correction. This uses a newStreamingEvent::RevisePartial. Once you stop, nothing more is erased; the last phrase is only appended.no_verbatimare set through[elevenlabs],--elevenlabs-*flags orVOXTYPE_ELEVENLABS_*variables.Each of the four commits can be reviewed on its own:
feat: let streaming backends revise provisional text: the engine-neutralRevisePartialevent. Text that fell back to the clipboard is no longer counted as typed, so no BackSpace can reach it.feat: add ElevenLabs Scribe as a batch transcription enginefeat: stream ElevenLabs Scribe realtime transcription with live partials: the daemon changes are gated on the engine, so other backends behave as before.docs: document the ElevenLabs engineRelated Issue
Fixes #545
Type of Change
Testing
cargo testand all tests passcargo clippy -- -D warningswith no warningscargo fmtEvery commit passes
cargo fmt --check,cargo clippy --all-targets --no-deps -- -D warningsandcargo test --lib, with and without--features elevenlabs. The realtime tests drive the session against a scripted socket on a paused clock, with no network calls. Batch, realtime and partials were also tried against the live API on a Wayland desktop.Documentation
Pre-merge checklist
devbranch (notmain)ci-successto pass before marking Ready for ReviewAdditional Notes
Two limitations shared with the existing engines, left for separate changes:
voxtype config getandvoxtype config schemaprint[elevenlabs] api_keyin plain text, as they already do for the Soniox, remote Whisper and meeting summary keys. Redacting them belongs in one change covering every secret.