use thiserror::Error;
#[derive(Debug, Error)]
pub enum AppError {
#[error("I/O error: {0}")]
Io(#[from] std::io::Error),
#[error("API request failed: {0}")]
Api(#[from] reqwest::Error),
#[error("OPENAI_API_KEY is not set.")]
ApiKeyMissing,
#[error("Failed to get a response from the AI.")]
NoResponse,
}
pub type Result<T> = std::result::Result<T, AppError>;