use serde::{Deserialize, Serialize};
#[derive(Debug, Default, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
pub enum RealTimeModel {
#[serde(rename = "glm-4-voice")]
#[default]
Glm4Voice,
#[serde(rename = "glm-4.5-voice")]
Glm45Voice,
}
impl RealTimeModel {
pub fn as_str(&self) -> &'static str {
match self {
Self::Glm4Voice => "glm-4-voice",
Self::Glm45Voice => "glm-4.5-voice",
}
}
pub fn supports_transcription(&self) -> bool {
matches!(self, Self::Glm4Voice | Self::Glm45Voice)
}
pub fn supports_synthesis(&self) -> bool {
matches!(self, Self::Glm4Voice | Self::Glm45Voice)
}
}
impl std::fmt::Display for RealTimeModel {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str(self.as_str())
}
}