Add comprehensive RustDocs for all public API items

- Add crate-level docs with usage examples for lib.rs
- Document OllamaClient, OllamaClientBuilder, and all public methods
- Document error module with OllamaError variants and OllamaResult
- Document types module with endpoint mapping table
- Document all types in common, chat, generate, ps, pull, tags, version
- Add doc examples for builders, constructors, and key types
- All 26 doc-tests pass
This commit is contained in:
2026-01-30 20:16:15 +00:00
parent c6450b774a
commit f15a2c53d6
10 changed files with 767 additions and 41 deletions

View File

@@ -1,3 +1,20 @@
//! Request and response types for the Ollama API.
//!
//! Each submodule corresponds to an API endpoint:
//!
//! | Module | Endpoint | Description |
//! |--------------|-------------------|------------------------------------------|
//! | [`chat`] | `POST /api/chat` | Multi-turn chat conversations |
//! | [`generate`] | `POST /api/generate` | Single-prompt text generation |
//! | [`pull`] | `POST /api/pull` | Download models from the registry |
//! | [`tags`] | `GET /api/tags` | List available models |
//! | [`ps`] | `GET /api/ps` | List currently loaded/running models |
//! | [`version`] | `GET /api/version` | Query the server version |
//!
//! The [`common`] module contains types shared across multiple endpoints, such as
//! [`Options`](common::Options) for generation parameters, [`Think`](common::Think)
//! for reasoning mode, and [`ModelDetails`](common::ModelDetails).
pub mod chat;
pub mod common;
pub mod generate;