1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
//! A Rust SDK for interacting with the Ollama API.
//!
//! This crate provides a convenient and type-safe way to communicate with an Ollama server,
//! allowing you to interact with various language models, perform chat completions,
//! generate text, and manage models.
//!
//! ## Features
//!
//! - **Idiomatic Rust API:** Designed with Rust's best practices in mind.
//! - **Streaming support**: Handle streaming responses for chat and generate operations efficiently.
//! - **Configurable Transport:** Uses `reqwest` by default, with an extensible [`Transport`](crate::transport::Transport) trait for custom implementations.
//! - **Robust Error Handling:** Comprehensive error types for predictable error management.
//! - **Observability:** Optional `tracing` for detailed logging and `metrics` for performance monitoring.
//! - **Tooling Integration**: Support for tool definitions and registry.
//!
//! ## Getting Started
//!
//! To use this SDK, add `ollama-sdk` to your `Cargo.toml`.
//!
//! Check `examples` directory in GitHub for example usages.
use Error;
pub use crate::;
/// An alias for [`std::result::Result<T, E>`] where E is [`enum@Error`].
pub type Result<T> = Result;
/// Represents errors that can occur when interacting with the Ollama API.