Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

feat(voice): expose configured model on cloud stt provider

Steven Enamakel94a7b7d218e4
diff --git a/crates/openhuman-tinyhumans/src/voice/speech_providers.rs b/crates/openhuman-tinyhumans/src/voice/speech_providers.rs
index 42b7274756..f113bee61f 100644
--- a/crates/openhuman-tinyhumans/src/voice/speech_providers.rs
+++ b/crates/openhuman-tinyhumans/src/voice/speech_providers.rs
@@ -48,6 +48,10 @@ impl SttProvider for CloudSttProvider {
"cloud"
}
+ fn configured_model(&self) -> Option<&str> {
+ Some(&self.model)
+ }
+
async fn transcribe(
&self,
config: &Config,
diff --git a/crates/openhuman-tinyhumans/src/voice/speech_providers_tests.rs b/crates/openhuman-tinyhumans/src/voice/speech_providers_tests.rs
index eaf86b9a1c..305d5dea02 100644
--- a/crates/openhuman-tinyhumans/src/voice/speech_providers_tests.rs
+++ b/crates/openhuman-tinyhumans/src/voice/speech_providers_tests.rs
@@ -41,3 +41,19 @@ fn the_callers_stt_model_is_passed_through() {
assert_eq!(stt_model(""), DEFAULT_CLOUD_STT_MODEL);
assert_eq!(stt_model(" "), DEFAULT_CLOUD_STT_MODEL);
}
+
+#[test]
+fn the_registered_stt_factory_builds_with_the_callers_model() {
+ register();
+ let config = Config::default();
+ let named = create_stt_provider("cloud", "whisper-large", &config).unwrap();
+ let default = create_stt_provider("openhuman", "", &config).unwrap();
+ for slug in STT_SLUGS {
+ unregister_stt_provider(slug);
+ }
+ for slug in TTS_SLUGS {
+ unregister_tts_provider(slug);
+ }
+ assert_eq!(named.configured_model(), Some("whisper-large"));
+ assert_eq!(default.configured_model(), Some(DEFAULT_CLOUD_STT_MODEL));
+}