Skip to content

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

refactor(channels): use host trait methods in startup callbacks

Steven Enamakel2e106c7a5f08
diff --git a/crates/openhuman-core/src/channels/runtime/startup/callback.rs b/crates/openhuman-core/src/channels/runtime/startup/callback.rs
index 65bc271521..cecbcf0bc5 100644
--- a/crates/openhuman-core/src/channels/runtime/startup/callback.rs
+++ b/crates/openhuman-core/src/channels/runtime/startup/callback.rs
@@ -113,7 +113,6 @@ impl ChannelHostCallbacks {
}
async fn persist_allowed_identity(&self, channel: String, identity: String) -> Result<()> {
- use tinychannels::host::AllowlistStore as _;
crate::channels::host::ConfigAllowlistStore
.persist_allowed_identity(&channel, &identity)
.await
@@ -187,30 +186,18 @@ impl ChannelHostCallbacks {
{
return Err(Error::failed("transcription callback exceeds its limit"));
}
- use tinychannels::host::Transcriber as _;
crate::channels::host::VoiceTranscriber {
config: Arc::clone(&self.config),
}
- .transcribe(tinychannels::host::TranscriptionRequest {
- audio_base64: request.audio_base64,
- mime_type: request.mime_type,
- file_name: request.file_name,
- language: request.language,
- })
+ .transcribe_host(request)
.await
- .map(|result| HostTranscriptionResult {
- text: result.text,
- language: result.language,
- duration_secs: result.duration_secs,
- })
.map_err(|_| Error::failed("channel transcription failed"))
}
async fn publish_event(&self, publication: HostEventPublication) -> Result<()> {
Self::validate_callback_size(&publication)?;
- use tinychannels::host::EventSink as _;
crate::channels::host::OpenHumanEventSink
- .publish(&publication.domain, &publication.kind, publication.payload)
+ .publish_host(&publication.domain, &publication.kind, publication.payload)
.await
.map_err(|_| Error::failed("channel event publication failed"))
}