Removes unneccessary override of OllamaRequestBody method

This commit is contained in:
Markus Klenke 2024-02-09 21:58:17 +00:00
parent 5c5cdba4cd
commit 273b1e47ca

View File

@ -1,14 +1,11 @@
package io.github.amithkoujalgi.ollama4j.core.models.chat;
import java.net.http.HttpRequest;
import java.net.http.HttpRequest.BodyPublisher;
import java.util.List;
import com.fasterxml.jackson.core.JsonProcessingException;
import io.github.amithkoujalgi.ollama4j.core.utils.OllamaRequestBody;
import io.github.amithkoujalgi.ollama4j.core.utils.Options;
import io.github.amithkoujalgi.ollama4j.core.utils.Utils;
import static io.github.amithkoujalgi.ollama4j.core.utils.Utils.getObjectMapper;
@ -48,14 +45,4 @@ public class OllamaChatRequestModel implements OllamaRequestBody{
}
}
@Override
public BodyPublisher getBodyPublisher() {
try {
return HttpRequest.BodyPublishers.ofString(
Utils.getObjectMapper().writeValueAsString(this));
} catch (JsonProcessingException e) {
throw new IllegalArgumentException("Request not Body convertible.",e);
}
}
}