Refactor to tags and ps

This commit is contained in:
2025-12-28 20:35:04 +00:00
parent 7251ac07bd
commit d7cb16a6d8
6 changed files with 25 additions and 36 deletions

View File

@@ -8,8 +8,8 @@ async fn main() -> Result<(), Box<dyn Error>> {
let _ = dotenvy::dotenv();
let server_address = env::var("OLLAMA_SERVER")?;
let ollama_client = OllamaClient::new(server_address);
let models = ollama_client.list_runnning_models().await?;
for model in models {
let result = ollama_client.ps().await?;
for model in result.models {
println!("{:?}", model);
}
Ok(())

View File

@@ -8,8 +8,8 @@ async fn main() -> Result<(), Box<dyn Error>> {
let _ = dotenvy::dotenv();
let server_address = env::var("OLLAMA_SERVER")?;
let ollama_client = OllamaClient::new(server_address);
let models = ollama_client.tags().await?;
for model in models {
let response = ollama_client.tags().await?;
for model in response.models {
println!("{:?}", model);
}
Ok(())