use thiserror::Error;
#[derive(Debug, Error)]
pub enum OllamaError {
#[error("Request failed: {0}")]
Request(#[from] reqwest::Error),
#[error("API error ({status}): {message}")]
Api { status: u16, message: String },
#[error("Model not found: {0}")]
ModelNotFound(String),
#[error("Connection refused: is Ollama running?")]
ConnectionRefused,
#[error("JSON error: {0}")]
Json(#[from] serde_json::Error),
#[error("Invalid request: {0}")]
InvalidRequest(String),
}
pub type Result<T> = std::result::Result<T, OllamaError>;