diff --git a/crates/arr-subs/src/translate.rs b/crates/arr-subs/src/translate.rs index d448047..7b9423b 100644 --- a/crates/arr-subs/src/translate.rs +++ b/crates/arr-subs/src/translate.rs @@ -154,6 +154,7 @@ pub type Result = std::result::Result; /// Strip a ```` ```json ```` / ```` ``` ```` fence a model wrapped its reply /// in despite being told not to. Cheaper than retrying the whole batch over a /// habit some models never break. +#[cfg(any(feature = "translate-openai", feature = "translate-command"))] pub(crate) fn strip_code_fence(content: &str) -> &str { let trimmed = content.trim(); let trimmed = trimmed @@ -164,6 +165,7 @@ pub(crate) fn strip_code_fence(content: &str) -> &str { } /// How a language reads in a prompt meant for an LLM, not a settings row. +#[cfg(any(feature = "translate-openai", feature = "translate-command"))] pub(crate) fn language_name(language: &Language) -> String { match language { Language::PortuguesePortugal => "European Portuguese (pt-PT)".to_owned(), @@ -177,6 +179,7 @@ pub(crate) fn language_name(language: &Language) -> String { /// answering the wrong Portuguese. Generic advice ("respect the variant") /// is easy for a model to nod at and ignore; naming the words it must not /// reach for is not. +#[cfg(any(feature = "translate-openai", feature = "translate-command"))] fn variant_note(target: &Language) -> Option<&'static str> { match target { Language::PortuguesePortugal => Some( @@ -195,6 +198,7 @@ fn variant_note(target: &Language) -> Option<&'static str> { /// The instruction every LLM-shaped backend sends ahead of the batch. Shared /// rather than per-backend so the reply contract — JSON only, every cue back /// under its original number — cannot drift between them. +#[cfg(any(feature = "translate-openai", feature = "translate-command"))] pub(crate) fn system_prompt(source: &Language, target: &Language) -> String { let mut prompt = format!( "You translate subtitle cues for a film or TV episode from {} into {}. Write natural, \