Watch
0
0
Fork
You've already forked hyperhive
0

agents can transcribe an audio file: the transcribe_audio tool, through the harness and the speech-to-text service

This commit is contained in:
damocles 2026-11-12 10:14:54 +01:00 • committed by mara
commit eff209f756

View file

@ -302,6 +302,26 @@ pub(super) async fn mark_local_todos_done(ids: Vec<i64>) -> Option<hive_agent_so
dial_agent_socket(&hive_agent_sock::Request::MarkTodosDone { ids }).await
}
/// Ask the harness for the text of the audio file at `path`. The harness
/// waits on the swarm's speech-to-text service, which queues requests behind
/// one engine slot, so this waits much longer than any other socket call.
pub(super) async fn transcribe_local(path: String) -> Option<hive_agent_sock::Response> {
let socket = std::env::var_os("HIVE_AGENT_SOCKET").map(std::path::PathBuf::from)?;
if !socket.exists() {
return None;
}
dial_socket(
&socket,
&hive_agent_sock::Request::Transcribe { path },
TRANSCRIBE_DEADLINE,
)
.await
}
/// Longest a `transcribe_audio` call waits: the service's reply deadline (15
/// minutes, `swarm_wire::stt::REPLY_DEADLINE`) plus a margin for the harness.
const TRANSCRIBE_DEADLINE: std::time::Duration = std::time::Duration::from_mins(16);
/// Format a `Vec<MatrixRoomUnread>` into a per-room summary string.
/// Single room / single message collapses to one line; multi-room
/// expands to a bulleted list. Returns an empty string for empty input.