diff --git a/CHANGELOG.md b/CHANGELOG.md index a976a37..18f2139 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## v0.2.0 + +The owl picked up a few new tricks. 🦉✨ Whisper transcripts can now take a quick detour through your favorite local LLM to get cleaned up, summarized, or remixed before they land in your app. + +- Added an opt-in LLM post-processing engine with a local-only HTTP client, presets for formatting or summarizing, and full custom prompt support. +- Expanded Settings with a dedicated LLM tab: configure base URL/model, control auto-paste behavior, and inspect recent history saved to disk. +- Published a new `llm-postprocess` guide and refreshed the manual so you can get up and running with Ollama, LM Studio, and friends. +- Trimmed unused diff logging code to keep builds leaner. + ## v0.1.0 HootVoice takes the stage for the very first time — cue the confetti! 🎉 diff --git a/Cargo.lock b/Cargo.lock index 3254efb..356eb8c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2043,7 +2043,7 @@ dependencies = [ [[package]] name = "hootvoice" -version = "0.1.0" +version = "0.2.0" dependencies = [ "anyhow", "chrono", @@ -2073,7 +2073,6 @@ dependencies = [ "serde_json", "serde_yaml", "signal-hook", - "similar", "sys-locale", "toml", "tracing", @@ -4083,12 +4082,6 @@ version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" -[[package]] -name = "similar" -version = "2.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbbb5d9659141646ae647b42fe094daf6c6192d1620870b449d9557f748b2daa" - [[package]] name = "slab" version = "0.4.11" diff --git a/Cargo.toml b/Cargo.toml index c8d4853..941e095 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hootvoice" -version = "0.1.0" +version = "0.2.0" edition = "2021" authors = ["HootVoice Team"] description = "HootVoice — High‑accuracy voice input (Whisper)" @@ -42,7 +42,6 @@ serde_json = "1.0" toml = "0.8" serde_yaml = "0.9" image = { version = "0.24", default-features = false, features = ["png", "jpeg"] } -similar = "2.6" # GUI egui = "0.32" diff --git a/assets/THIRD_PARTY_LICENSES.md b/assets/THIRD_PARTY_LICENSES.md index 379b37b..6e01f81 100644 --- a/assets/THIRD_PARTY_LICENSES.md +++ b/assets/THIRD_PARTY_LICENSES.md @@ -11085,7 +11085,7 @@ SOFTWARE. Used by: -- hootvoice 0.1.0 (https://github.com/agata/hootvoice) +- hootvoice 0.2.0 (https://github.com/agata/hootvoice) License text: @@ -12691,4 +12691,3 @@ the following restrictions: --- - diff --git a/src/core/postprocess.rs b/src/core/postprocess.rs index a3d862f..5686142 100644 --- a/src/core/postprocess.rs +++ b/src/core/postprocess.rs @@ -3,7 +3,6 @@ use crate::llm::{ history_file_path, record_history, LlmPostProcessSettings, LlmPostProcessor, MAX_HISTORY_ENTRIES, }; -use similar::{ChangeTag, TextDiff}; use std::sync::{Arc, Mutex}; pub struct PostProcessResult { @@ -66,7 +65,7 @@ impl PostProcessEngine { let mut final_text = base_text.to_string(); let mut llm_latency_secs = 0.0f32; - let mut llm_output_for_diff: Option = None; + let mut llm_output_for_log: Option = None; let mut history_payload: Option<(String, bool, u128)> = None; match self @@ -93,7 +92,7 @@ impl PostProcessEngine { &format!("[llm] Completed in {:.2}s.", llm_latency_secs), ); log_message(log, &format!("[llm][output] {}", content)); - llm_output_for_diff = Some(content.clone()); + llm_output_for_log = Some(content.clone()); if snapshot.apply_to_autopaste { final_text = content.clone(); } else { @@ -144,41 +143,11 @@ impl PostProcessEngine { } } - if let Some(output_text) = llm_output_for_diff.as_ref() { + if let Some(output_text) = llm_output_for_log.as_ref() { if output_text == base_text { log_message(log, "[llm] Output identical to Whisper text."); } else { - let diff = TextDiff::from_lines(base_text, output_text); - let mut diff_lines = Vec::new(); - let mut truncated = false; - for change in diff.iter_all_changes() { - let prefix = match change.tag() { - ChangeTag::Delete => "-", - ChangeTag::Insert => "+", - ChangeTag::Equal => continue, - }; - if diff_lines.len() >= 120 { - truncated = true; - break; - } - let mut line = change.value().trim_end_matches('\n').to_string(); - if line.chars().count() > 200 { - let mut truncated = String::with_capacity(201); - truncated.extend(line.chars().take(200)); - truncated.push_str("…"); - line = truncated; - } - diff_lines.push(format!("{}{}", prefix, line)); - } - - if diff_lines.is_empty() { - log_message(log, "[llm] Output identical to Whisper text."); - } else { - if truncated { - diff_lines.push("... (diff truncated)".to_string()); - } - log_message(log, &format!("[llm][diff]\n{}", diff_lines.join("\n"))); - } + log_message(log, "[llm] Output differs from Whisper text."); } }