feat(ai-formatting): wire dictionary_terms through PostProcessOptions to LLM prompt suffix
This commit is contained in:
@@ -9,6 +9,9 @@ pub struct PostProcessOptions {
|
||||
pub british_english: bool,
|
||||
pub anti_hallucination: bool,
|
||||
pub format_mode: FormatMode,
|
||||
/// Custom vocabulary terms loaded from the user's dictionary. Injected
|
||||
/// into the LLM cleanup prompt so the model knows how to spell them.
|
||||
pub dictionary_terms: Vec<String>,
|
||||
}
|
||||
|
||||
/// How aggressively to format the transcript text.
|
||||
@@ -82,6 +85,19 @@ mod tests {
|
||||
]
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn dictionary_terms_stored_on_options() {
|
||||
let options = PostProcessOptions {
|
||||
remove_fillers: false,
|
||||
british_english: false,
|
||||
anti_hallucination: false,
|
||||
format_mode: FormatMode::Raw,
|
||||
dictionary_terms: vec!["Wren".to_string(), "CORBEL".to_string()],
|
||||
};
|
||||
assert_eq!(options.dictionary_terms.len(), 2);
|
||||
assert_eq!(options.dictionary_terms[0], "Wren");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn post_process_applies_all_filters() {
|
||||
let mut segments = make_segments();
|
||||
@@ -90,6 +106,7 @@ mod tests {
|
||||
british_english: true,
|
||||
anti_hallucination: true,
|
||||
format_mode: FormatMode::Clean,
|
||||
dictionary_terms: vec![],
|
||||
};
|
||||
|
||||
post_process_segments(&mut segments, &options);
|
||||
@@ -110,6 +127,7 @@ mod tests {
|
||||
british_english: false,
|
||||
anti_hallucination: false,
|
||||
format_mode: FormatMode::Smart,
|
||||
dictionary_terms: vec![],
|
||||
};
|
||||
|
||||
post_process_segments(&mut segments, &options);
|
||||
|
||||
Reference in New Issue
Block a user