Adds sync-response interpreter for responseCode 400

This commit is contained in:
Markus Klenke 2024-02-12 21:30:55 +00:00
parent bc885894f8
commit bbcd458849

View File

@ -90,6 +90,11 @@ public abstract class OllamaEndpointCaller {
Utils.getObjectMapper()
.readValue("{\"error\":\"Unauthorized\"}", OllamaErrorResponseModel.class);
responseBuffer.append(ollamaResponseModel.getError());
} else if (statusCode == 400) {
LOG.warn("Status code: 400 (Bad Request)");
OllamaErrorResponseModel ollamaResponseModel = Utils.getObjectMapper().readValue(line,
OllamaErrorResponseModel.class);
responseBuffer.append(ollamaResponseModel.getError());
} else {
boolean finished = parseResponseAndAddToBuffer(line,responseBuffer);
if (finished) {