mod models;
mod utils;
pub mod pipelines;
pub(crate) const DEFAULT_TEMPERATURE: f64 = 0.7;
pub(crate) const DEFAULT_REPEAT_PENALTY: f32 = 1.1;
pub(crate) const DEFAULT_REPEAT_LAST_N: usize = 64;
pub(crate) const DEFAULT_SEED: u64 = 299792458;
#[derive(Debug, Clone, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
pub struct Message {
role: String,
content: String,
}
impl Message {
pub fn system(content: &str) -> Self {
Self {
role: "system".to_string(),
content: content.to_string(),
}
}
pub fn user(content: &str) -> Self {
Self {
role: "user".to_string(),
content: content.to_string(),
}
}
pub fn assistant(content: &str) -> Self {
Self {
role: "assistant".to_string(),
content: content.to_string(),
}
}
pub fn role(&self) -> &str {
&self.role
}
pub fn content(&self) -> &str {
&self.content
}
}