use crate::prelude::*;
#[derive(Clone, Copy, Debug, Display, Serialize, Deserialize, Eq, PartialEq)]
#[serde(rename_all = "lowercase")]
pub enum Role {
System,
User,
Assistant,
Tool,
}
impl Role {
pub fn is_system(&self) -> bool {
matches!(self, Self::System)
}
pub fn is_user(&self) -> bool {
matches!(self, Self::User)
}
pub fn is_assistant(&self) -> bool {
matches!(self, Self::Assistant)
}
pub fn is_tool(&self) -> bool {
matches!(self, Self::Tool)
}
}