From 4260fbbc32b7fcf34a53cac7898b56218bf812af Mon Sep 17 00:00:00 2001 From: Markus Klenke Date: Sat, 10 Feb 2024 00:24:12 +0000 Subject: [PATCH] Fixes OllamaAPI after Renaming --- .../io/github/amithkoujalgi/ollama4j/core/OllamaAPI.java | 8 ++++---- .../ollama4j/core/models/chat/OllamaChatMessage.java | 2 ++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/OllamaAPI.java b/src/main/java/io/github/amithkoujalgi/ollama4j/core/OllamaAPI.java index af39c66..a0212d7 100644 --- a/src/main/java/io/github/amithkoujalgi/ollama4j/core/OllamaAPI.java +++ b/src/main/java/io/github/amithkoujalgi/ollama4j/core/OllamaAPI.java @@ -10,8 +10,8 @@ import io.github.amithkoujalgi.ollama4j.core.models.request.CustomModelFileConte import io.github.amithkoujalgi.ollama4j.core.models.request.CustomModelFilePathRequest; import io.github.amithkoujalgi.ollama4j.core.models.request.ModelEmbeddingsRequest; import io.github.amithkoujalgi.ollama4j.core.models.request.ModelRequest; -import io.github.amithkoujalgi.ollama4j.core.models.request.OllamaChatRequestCaller; -import io.github.amithkoujalgi.ollama4j.core.models.request.OllamaGenerateRequestCaller; +import io.github.amithkoujalgi.ollama4j.core.models.request.OllamaChatEndpointCaller; +import io.github.amithkoujalgi.ollama4j.core.models.request.OllamaGenerateEndpointCaller; import io.github.amithkoujalgi.ollama4j.core.utils.Options; import io.github.amithkoujalgi.ollama4j.core.utils.Utils; import java.io.BufferedReader; @@ -450,7 +450,7 @@ public class OllamaAPI { * @throws InterruptedException in case the server is not reachable or network issues happen */ public OllamaChatResult chat(OllamaChatRequestModel request) throws OllamaBaseException, IOException, InterruptedException{ - OllamaChatRequestCaller requestCaller = new OllamaChatRequestCaller(host, basicAuth, requestTimeoutSeconds, verbose); + OllamaChatEndpointCaller requestCaller = new OllamaChatEndpointCaller(host, basicAuth, requestTimeoutSeconds, verbose); //TODO: implement async way if(request.isStream()){ throw new UnsupportedOperationException("Streamed chat responses are not implemented yet"); @@ -485,7 +485,7 @@ public class OllamaAPI { private OllamaResult generateSyncForOllamaRequestModel(OllamaRequestModel ollamaRequestModel) throws OllamaBaseException, IOException, InterruptedException { - OllamaGenerateRequestCaller requestCaller = new OllamaGenerateRequestCaller(host, basicAuth, requestTimeoutSeconds, verbose); + OllamaGenerateEndpointCaller requestCaller = new OllamaGenerateEndpointCaller(host, basicAuth, requestTimeoutSeconds, verbose); return requestCaller.generateSync(ollamaRequestModel); } diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/chat/OllamaChatMessage.java b/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/chat/OllamaChatMessage.java index cd0becd..b877ddf 100644 --- a/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/chat/OllamaChatMessage.java +++ b/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/chat/OllamaChatMessage.java @@ -8,6 +8,7 @@ import java.util.List; import lombok.AllArgsConstructor; import lombok.Data; +import lombok.NoArgsConstructor; import lombok.NonNull; import lombok.RequiredArgsConstructor; @@ -19,6 +20,7 @@ import lombok.RequiredArgsConstructor; @Data @AllArgsConstructor @RequiredArgsConstructor +@NoArgsConstructor public class OllamaChatMessage { @NonNull