Repository navigation
feat: bare-list Whisper prompt with a 224-token budget (#53) - #58
Merged
Merged
Conversation
- config: VocabularyTerm(term, language); normalize accepts terms, dicts and legacy
strings, dedups by term across languages; select_vocabulary() picks the dictation's
language terms then All-languages terms (primary subtag match)
- persistence: JSON array of {"term", "language"} objects; legacy string lists load as
All languages and are rewritten on the next save
- stt/rewrite: both use the same select_vocabulary() pick for stt_language
- settings: Vocabulary tab is a Term | Language table with a per-row language combo
- docs and tests
Closes #52
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- stt: build_whisper_prompt() renders the vocabulary as prior transcript text
("PySide6, Qt, httpx.") with no English header or quotes; terms are added whole
in select_vocabulary order until WHISPER_PROMPT_TOKEN_BUDGET (224) by a
conservative estimate, ceil(UTF-8 bytes / 2); the first term that does not fit
ends the list
- stt: each dictation logs "STT prompt: N terms sent, M omitted (token budget)",
counts only
- settings: STT Advanced shows the prompt estimate for the dialog's language and a
warning with the skipped count; refreshes on vocabulary or language edits
- settings: choosing the OpenAI or Groq STT preset turns on "Send vocabulary" for
that role; defaults and saved settings are unchanged
- docs and tests
Closes #53
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…cument prompt budget in README Terms in the vocabulary table are editable in place, which bypassed the estimate/overflow refresh added for the Whisper prompt budget. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…58 beyond conflict resolution)
DavidHruby1
added a commit
that referenced
this pull request
Nov 4, 2026
DavidHruby1
added a commit
that referenced
this pull request
Nov 4, 2026
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.
Closes #53. Stacked on #57 (#52) — this branch is based on
feat/vocabulary-language-tags, so until #57 merges the diff also shows its commit. Merge #57 first.Changes
stt.build_whisper_prompt(terms) -> (prompt, omitted)sends a bare list like prior transcript text:PySide6, Qt, httpx.NoPreferred spellings:header and no JSON quotes, so the prompt no longer pulls the transcript toward English. Terms containing a comma are kept as they are.WHISPER_PROMPT_TOKEN_BUDGET = 224, estimated without a tokenizer byestimate_prompt_tokens = ceil(UTF-8 bytes / 2). Terms are added whole inselect_vocabularyorder (language terms first, then All languages). The first term that doesn't fit ends the list, so the cut is deterministic.STT prompt: N terms sent, M omitted (token budget). Only the counts are logged, never the terms.Prompt for Czech: ~N / 224 tokensfor the dialog's language. With Auto it counts only All-languages terms. When terms don't fit, ahush="warning"label says how many will be skipped. Both refresh when the vocabulary (add/edit/remove/row language) or the language changes.AppConfigdefault staysFalseand saved configs are not migrated.docs/IMPLEMENTATION.mdupdated (stt API, runtime behavior).Decisions on the open questions
Tests
tests/test_whisper_prompt.py: prompt shape, empty selection → nopromptfield, deterministic cut with language terms first, first non-fitting term stops the list, log shows counts without terms, settings estimate/warning and refresh, OpenAI/Groq presets enable the toggle while Custom/local don't change it.tests/test_vocabulary_languages.pyupdated for the new prompt shape.python -m unittest discover -s tests: 489 tests, OK.test_tray_menu…test_exit_during_initial_settings_stops_outer_event_loopsometimes fails on a timeout. It fails the same way on the base branch without this change.