stt-cli 0.2.1

Speech to text Cli using Groq API and OpenAI API
// src/transcription/result_handler.rs
// Defines the trait for handling transcription results.

use crate::platform::InsertOptions;
use anyhow::Result;

/// A trait for components that handle the output (text) of a transcription.
/// This allows decoupling the transcription process from how the text is used
/// (e.g., inserting into a text area, sending over a network, etc.).
pub trait TranscriptionResultHandler: Send + Sync {
    /// Handles the transcribed text.
    ///
    /// # Arguments
    ///
    /// * `text` - The transcribed text string.
    /// * `options` - Options for handling the text (e.g., formatting).
    ///
    /// # Returns
    ///
    /// * `Result<()>` - Ok if handling was successful, Err otherwise.
    fn handle_result(&mut self, text: &str, options: InsertOptions) -> Result<()>;
}