Adds version method
This commit is contained in:
10
src/lib.rs
10
src/lib.rs
@@ -16,6 +16,7 @@ use crate::{
|
||||
ps::RunningModel,
|
||||
pull::{PullRequest, PullResponse},
|
||||
tags::Model,
|
||||
version::VersionResponse,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -33,6 +34,15 @@ impl OllamaClient {
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn version(&self) -> OllamaResult<VersionResponse> {
|
||||
let request_address = format!("{}/api/version", self.server_address);
|
||||
Ok(reqwest::get(request_address)
|
||||
.await?
|
||||
.error_for_status()?
|
||||
.json()
|
||||
.await?)
|
||||
}
|
||||
|
||||
/// Fetch a list of models and their details
|
||||
pub async fn tags(&self) -> OllamaResult<Vec<Model>> {
|
||||
let request_address = format!("{}/api/tags", self.server_address);
|
||||
|
||||
Reference in New Issue
Block a user