Skip to content

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

refactor(speech): extract configured provider factory type alias

Steven Enamakel09124f323e0f
diff --git a/crates/openhuman-core/src/inference/host_runtime/service/speech.rs b/crates/openhuman-core/src/inference/host_runtime/service/speech.rs
index cdbf34d086..3b2c7bac37 100644
--- a/crates/openhuman-core/src/inference/host_runtime/service/speech.rs
+++ b/crates/openhuman-core/src/inference/host_runtime/service/speech.rs
@@ -83,6 +83,9 @@ pub async fn transcribe_bytes(
})
}
+type ConfiguredProviderFactory<'a> =
+ dyn Fn(&Config) -> Result<Box<dyn SttProvider>, String> + Send + Sync + 'a;
+
fn selected_stt_provider<'a>(
config: &'a Config,
provider_name: &str,
@@ -98,8 +101,7 @@ fn selected_stt_provider<'a>(
struct ConfiguredSttProvider<'a> {
config: &'a Config,
- provider_factory:
- Box<dyn Fn(&Config) -> Result<Box<dyn SttProvider>, String> + Send + Sync + 'a>,
+ provider_factory: Box<ConfiguredProviderFactory<'a>>,
}
#[async_trait::async_trait]