feat(whisper): feed profile_terms into initial_prompt at decode time
Previously profile_terms only reached the LLM cleanup stage as the
dictionary_terms suffix. Whisper decoded without any vocabulary hint, so
domain names ('Wren', 'CORBEL') were misspelled on the first pass and the
LLM had to guess at the correction.
build_initial_prompt (src-tauri/src/commands/mod.rs) collapses caller /
profile / terms into a single Whisper prompt:
caller_prompt > profile_prompt + "Vocabulary: <terms>." > None
transcribe_pcm, transcribe_file, and start_live_transcription_session all
route through the helper, so the three paths stay in lockstep.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -12,6 +12,7 @@ use serde::{Deserialize, Serialize};
|
||||
use tauri::ipc::Channel;
|
||||
|
||||
use crate::commands::audio::persist_audio_samples;
|
||||
use crate::commands::build_initial_prompt;
|
||||
use crate::commands::models::{default_model_id_for_engine, ensure_model_loaded};
|
||||
use crate::AppState;
|
||||
use kon_ai_formatting::{post_process_segments, FormatMode, PostProcessOptions};
|
||||
@@ -214,16 +215,13 @@ pub async fn start_live_transcription_session(
|
||||
|
||||
// Collapse the effective initial_prompt on the struct so downstream
|
||||
// `TranscriptionOptions` construction (see `maybe_dispatch_chunk`) picks
|
||||
// up profile fallback without further plumbing.
|
||||
let effective_prompt = match config.initial_prompt.as_deref() {
|
||||
Some(p) if !p.is_empty() => p.to_string(),
|
||||
_ => profile.initial_prompt.clone(),
|
||||
};
|
||||
config.initial_prompt = if effective_prompt.is_empty() {
|
||||
None
|
||||
} else {
|
||||
Some(effective_prompt)
|
||||
};
|
||||
// up profile fallback + vocabulary injection without further plumbing.
|
||||
let request_prompt = config.initial_prompt.clone().unwrap_or_default();
|
||||
config.initial_prompt = build_initial_prompt(
|
||||
&request_prompt,
|
||||
&profile.initial_prompt,
|
||||
&profile_terms,
|
||||
);
|
||||
|
||||
let model_id = config
|
||||
.model_id
|
||||
|
||||
Reference in New Issue
Block a user