bunsen-tool 0.43.0

bunsen's models on the command line: speech to text (Parakeet, Qwen3-ASR, Voxtral Realtime, Whisper) and who spoke when (Sortformer), text to speech (ZONOS3, Qwen3-TTS), chat (Qwen3, Qwen3.5, Gemma, nanochat) and typed decisions (Laya). The chat driver is also a library, `bunsen_tool::chat`.
Documentation
//! `asr diarize`: the command group.

mod asr_diarize_args;
#[cfg(feature = "live")]
mod asr_diarize_live;
mod asr_diarize_run;
mod support;

pub use asr_diarize_args::*;
#[cfg(feature = "live")]
pub use asr_diarize_live::*;
pub use asr_diarize_run::*;
use bunsen::errors::BunsenResult;
pub use support::load_diarizer;
use support::{
    JsonDiarization,
    JsonTurn,
    speaker_totals,
    text_line,
};

use crate::asr::{
    AsrKit,
    AsrKitFetchCommand,
    AsrKitListCommand,
};

/// The diarizer's commands.
#[derive(clap::Args, Debug)]
pub struct AsrDiarizeCommandGroup {
    #[command(subcommand)]
    action: AsrDiarizeSubCommand,
}

#[derive(clap::Subcommand, Debug)]
enum AsrDiarizeSubCommand {
    /// List the models `--model` can name, their licences and files.
    ///
    /// Each file is marked with whether it is cached.
    List(AsrKitListCommand),

    /// Bring every file of the named models into the weights cache.
    Fetch(AsrKitFetchCommand),

    /// Diarize audio files: each one's speaker turns.
    Run(AsrDiarizeRunCommand),

    /// Diarize the microphone: each speaker turn as it closes.
    #[cfg(feature = "live")]
    Live(AsrDiarizeLiveCommand),
}

impl AsrDiarizeCommandGroup {
    pub fn run(&self) -> BunsenResult<()> {
        match &self.action {
            AsrDiarizeSubCommand::List(list) => list.run(AsrKit::Diarizer),
            AsrDiarizeSubCommand::Fetch(fetch) => fetch.run(AsrKit::Diarizer),
            AsrDiarizeSubCommand::Run(run) => run.run(),
            #[cfg(feature = "live")]
            AsrDiarizeSubCommand::Live(live) => live.run(),
        }
    }
}

#[cfg(test)]
mod tests;