ollama-client 0.1.0

Async and blocking Rust client for the Ollama API
Documentation
//! Error types for the Ollama client.

/// Errors returned by Ollama client operations.
#[derive(Debug, thiserror::Error)]
pub enum OllamaError {
    #[error("HTTP request failed: {0}")]
    Http(#[from] reqwest::Error),

    #[error("JSON error: {0}")]
    Json(#[from] serde_json::Error),

    #[error("Ollama API error ({status}): {message}")]
    Api { status: u16, message: String },

    #[error("stream ended unexpectedly")]
    UnexpectedEndOfStream,

    #[error("NDJSON line exceeds maximum size of {max_bytes} bytes")]
    LineTooLarge { max_bytes: usize },

    #[error("invalid base URL: {0}")]
    InvalidBaseUrl(String),

    #[error("invalid blob digest: {0}")]
    InvalidDigest(String),

    #[error("I/O error: {0}")]
    Io(#[from] std::io::Error),
}

pub type Result<T> = std::result::Result<T, OllamaError>;