#[derive(Debug, Clone)]
pub struct OllamaConfig {
pub host: String,
pub model: String,
pub num_ctx: Option<u32>,
pub temperature: Option<f32>,
pub top_p: Option<f32>,
pub top_k: Option<i32>,
}
impl Default for OllamaConfig {
fn default() -> Self {
Self {
host: "http://localhost:11434".to_string(),
model: "llama3.2".to_string(),
num_ctx: None,
temperature: None,
top_p: None,
top_k: None,
}
}
}
impl OllamaConfig {
pub fn new(model: impl Into<String>) -> Self {
Self { model: model.into(), ..Default::default() }
}
pub fn with_host(host: impl Into<String>, model: impl Into<String>) -> Self {
Self { host: host.into(), model: model.into(), ..Default::default() }
}
}