fix: handle ollama error responses

fixes: #138

- Added error field to ModelPullResponse
  - Enhanced error handling in doPullModel to check for errors in response body and throw OllamaBaseException with the specific error message
This commit is contained in:
Travis Lyons
2025-08-20 11:51:49 -04:00
parent 1e17e258b6
commit bae903f8ca
16 changed files with 298 additions and 45 deletions

View File

@@ -1,8 +1,8 @@
{
"label": "APIs - Extras",
"position": 4,
"link": {
"type": "generated-index",
"description": "Details of APIs to handle bunch of extra stuff."
}
"label": "APIs - Extras",
"position": 4,
"link": {
"type": "generated-index",
"description": "Details of APIs to handle bunch of extra stuff."
}
}

View File

@@ -13,9 +13,9 @@ public class Main {
public static void main(String[] args) {
String host = "http://localhost:11434/";
OllamaAPI ollamaAPI = new OllamaAPI(host);
ollamaAPI.ping();
}
}

View File

@@ -1,8 +1,8 @@
{
"label": "APIs - Generate",
"position": 3,
"link": {
"type": "generated-index",
"description": "Details of APIs to interact with LLMs."
}
"label": "APIs - Generate",
"position": 3,
"link": {
"type": "generated-index",
"description": "Details of APIs to interact with LLMs."
}
}

View File

@@ -1,8 +1,8 @@
{
"label": "APIs - Model Management",
"position": 2,
"link": {
"type": "generated-index",
"description": "Details of APIs to manage LLMs."
}
"label": "APIs - Model Management",
"position": 2,
"link": {
"type": "generated-index",
"description": "Details of APIs to manage LLMs."
}
}