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:
@@ -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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user