diff --git a/crates/local-stt-core/src/lib.rs b/crates/local-stt-core/src/lib.rs index 6e9870cac3..8018e44671 100644 --- a/crates/local-stt-core/src/lib.rs +++ b/crates/local-stt-core/src/lib.rs @@ -3,9 +3,6 @@ pub use hypr_local_model::{AmModel, CactusSttModel, LocalModel, SoniqoModel, Whi pub static SUPPORTED_MODELS: &[LocalModel] = &[ LocalModel::Soniqo(SoniqoModel::ParakeetStreaming), LocalModel::Soniqo(SoniqoModel::ParakeetBatch), - LocalModel::Soniqo(SoniqoModel::Omnilingual), - LocalModel::Soniqo(SoniqoModel::Qwen3Small), - LocalModel::Soniqo(SoniqoModel::Qwen3Large), LocalModel::Am(AmModel::ParakeetV2), LocalModel::Am(AmModel::ParakeetV3), LocalModel::Am(AmModel::WhisperLargeV3), @@ -87,7 +84,7 @@ mod tests { }) .collect::>(); - assert_eq!(supported_soniqo_models, SoniqoModel::all()); + assert_eq!(supported_soniqo_models, SoniqoModel::selectable()); } #[test] diff --git a/crates/transcribe-soniqo/src/lib.rs b/crates/transcribe-soniqo/src/lib.rs index 6861577a97..113f1835fe 100644 --- a/crates/transcribe-soniqo/src/lib.rs +++ b/crates/transcribe-soniqo/src/lib.rs @@ -64,14 +64,22 @@ pub enum SoniqoModel { } impl SoniqoModel { + const ALL: &'static [Self] = &[ + Self::ParakeetStreaming, + Self::ParakeetBatch, + Self::Omnilingual, + Self::Qwen3Small, + Self::Qwen3Large, + ]; + + const SELECTABLE: &'static [Self] = &[Self::ParakeetStreaming, Self::ParakeetBatch]; + pub const fn all() -> &'static [Self] { - &[ - Self::ParakeetStreaming, - Self::ParakeetBatch, - Self::Omnilingual, - Self::Qwen3Small, - Self::Qwen3Large, - ] + Self::ALL + } + + pub const fn selectable() -> &'static [Self] { + Self::SELECTABLE } pub const fn as_str(self) -> &'static str { @@ -162,7 +170,7 @@ impl FromStr for SoniqoModel { type Err = Error; fn from_str(value: &str) -> Result { - Self::all() + Self::ALL .iter() .copied() .find(|model| value == model.as_str() || value == model.repo()) @@ -771,6 +779,28 @@ mod tests { ); } + #[test] + fn all_includes_every_model_variant() { + assert_eq!( + SoniqoModel::all(), + &[ + SoniqoModel::ParakeetStreaming, + SoniqoModel::ParakeetBatch, + SoniqoModel::Omnilingual, + SoniqoModel::Qwen3Small, + SoniqoModel::Qwen3Large, + ] + ); + } + + #[test] + fn selectable_includes_advertised_models() { + assert_eq!( + SoniqoModel::selectable(), + &[SoniqoModel::ParakeetStreaming, SoniqoModel::ParakeetBatch] + ); + } + #[test] fn parakeet_models_support_documented_european_languages() { let english = "en-US".parse().unwrap();