Commit Graph

14 Commits

Author SHA1 Message Date
be4bacf362 Add Default impl for OllamaClient
Connects to http://localhost:11434, the standard local Ollama address.
Users can now use OllamaClient::default() for the common case instead
of always providing the server address explicitly.
2026-01-30 19:40:26 +00:00
b70cc1a62d Propagate parse errors in stream_response instead of silently dropping them
Previously, if serde_json::from_str failed on a streamed line, the
line was silently discarded and the caller had no indication that data
was lost. Now parse errors are yielded as OllamaError::ResponseParseError
so consumers can detect and handle unexpected API responses.

Empty lines from LinesCodec are skipped to avoid spurious parse errors
on blank input between chunks.
2026-01-30 19:28:02 +00:00
098dc4426f Reuse reqwest::Client across requests for connection pooling
Store a shared reqwest::Client on OllamaClient instead of creating
a new one per request. Previously, version(), tags(), and ps() each
used reqwest::get() which allocates a one-shot client, and
stream_response() called reqwest::Client::new() on every invocation.

Since reqwest::Client manages an internal connection pool, reusing it
enables TCP and TLS connection reuse across calls. Cloning the client
is cheap as it is Arc-backed internally.
2026-01-30 19:25:15 +00:00
f87a8497da More logging 2026-01-15 20:47:19 +00:00
69a9ce0de5 OllamaClient derives Clone 2026-01-07 14:24:08 +00:00
96bed8e85b Adds error_for_status() for ollama requests 2026-01-07 14:16:44 +00:00
53353eabe0 Adds function calling 2026-01-06 21:15:20 +00:00
d7cb16a6d8 Refactor to tags and ps 2025-12-28 20:35:04 +00:00
b2e7b7134e Adds version method 2025-12-28 13:23:14 +00:00
1c431715c6 Unifies streaming code 2025-12-28 12:50:47 +00:00
ac480881e4 Adds pull method and example 2025-12-28 12:18:35 +00:00
65ea1dcfec Adds chat and chat example 2025-12-24 16:55:34 +00:00
d06d69d132 Finishes the generate implementation 2025-12-24 15:58:23 +00:00
8a0c10c6fc Adds tags and ps methods 2025-12-23 22:04:38 +00:00