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.
This commit is contained in:
2026-01-30 19:40:26 +00:00
parent ac2137eedb
commit be4bacf362

View File

@@ -28,6 +28,12 @@ pub struct OllamaClient {
client: reqwest::Client, client: reqwest::Client,
} }
impl Default for OllamaClient {
fn default() -> Self {
Self::new("http://localhost:11434")
}
}
impl OllamaClient { impl OllamaClient {
pub fn new<S: AsRef<str>>(server_address: S) -> Self { pub fn new<S: AsRef<str>>(server_address: S) -> Self {
Self { Self {