use serde::{Deserialize, Serialize};
#[derive(Debug, Serialize, Deserialize)]
pub struct Word {
#[allow(missing_docs)]
pub word: String,
#[allow(missing_docs)]
pub start: f64,
#[allow(missing_docs)]
pub end: f64,
#[allow(missing_docs)]
pub confidence: f64,
#[allow(missing_docs)]
pub speaker: Option<i32>,
#[allow(missing_docs)]
pub punctuated_word: Option<String>,
#[allow(missing_docs)]
pub language: Option<String>,
}
#[derive(Debug, Serialize, Deserialize)]
pub struct Alternatives {
#[allow(missing_docs)]
pub transcript: String,
#[allow(missing_docs)]
pub words: Vec<Word>,
#[allow(missing_docs)]
pub confidence: f64,
#[allow(missing_docs)]
#[serde(default)]
pub languages: Vec<String>,
}
#[derive(Debug, Serialize, Deserialize)]
pub struct Channel {
#[allow(missing_docs)]
pub alternatives: Vec<Alternatives>,
}
#[derive(Debug, Serialize, Deserialize)]
pub struct ModelInfo {
#[allow(missing_docs)]
pub name: String,
#[allow(missing_docs)]
pub version: String,
#[allow(missing_docs)]
pub arch: String,
}
#[derive(Debug, Serialize, Deserialize)]
pub struct Metadata {
#[allow(missing_docs)]
pub request_id: String,
#[allow(missing_docs)]
pub model_info: ModelInfo,
#[allow(missing_docs)]
pub model_uuid: String,
}
#[derive(Debug, Serialize, Deserialize)]
#[serde(untagged)]
#[non_exhaustive]
pub enum StreamResponse {
#[allow(missing_docs)]
TranscriptResponse {
#[allow(missing_docs)]
#[serde(rename = "type")]
type_field: String,
#[allow(missing_docs)]
start: f64,
#[allow(missing_docs)]
duration: f64,
#[allow(missing_docs)]
is_final: bool,
#[allow(missing_docs)]
speech_final: bool,
#[allow(missing_docs)]
from_finalize: bool,
#[allow(missing_docs)]
channel: Channel,
#[allow(missing_docs)]
metadata: Metadata,
#[allow(missing_docs)]
channel_index: Vec<i32>,
},
#[allow(missing_docs)]
TerminalResponse {
#[allow(missing_docs)]
request_id: String,
#[allow(missing_docs)]
created: String,
#[allow(missing_docs)]
duration: f64,
#[allow(missing_docs)]
channels: u32,
},
#[allow(missing_docs)]
SpeechStartedResponse {
#[allow(missing_docs)]
#[serde(rename = "type")]
type_field: String,
#[allow(missing_docs)]
channel: Vec<u8>,
#[allow(missing_docs)]
timestamp: f64,
},
#[allow(missing_docs)]
UtteranceEndResponse {
#[allow(missing_docs)]
#[serde(rename = "type")]
type_field: String,
#[allow(missing_docs)]
channel: Vec<u8>,
#[allow(missing_docs)]
last_word_end: f64,
},
}