From afa09e87a54889e4abefb59b49c9edcec7f24955 Mon Sep 17 00:00:00 2001 From: Amith Koujalgi Date: Wed, 30 Oct 2024 11:02:37 +0530 Subject: [PATCH] Update OllamaAPI.java --- src/main/java/io/github/ollama4j/OllamaAPI.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/io/github/ollama4j/OllamaAPI.java b/src/main/java/io/github/ollama4j/OllamaAPI.java index 262d7a9..e636471 100644 --- a/src/main/java/io/github/ollama4j/OllamaAPI.java +++ b/src/main/java/io/github/ollama4j/OllamaAPI.java @@ -392,8 +392,7 @@ public class OllamaAPI { String responseBody = response.body(); if (statusCode == 200) { - OllamaEmbedResponseModel embeddingResponse = Utils.getObjectMapper().readValue(responseBody, OllamaEmbedResponseModel.class); - return embeddingResponse; + return Utils.getObjectMapper().readValue(responseBody, OllamaEmbedResponseModel.class); } else { throw new OllamaBaseException(statusCode + " - " + responseBody); } @@ -561,6 +560,7 @@ public class OllamaAPI { * Convenience method to call Ollama API without streaming responses. *

* Uses {@link #generateWithImageURLs(String, String, List, Options, OllamaStreamHandler)} + * * @throws OllamaBaseException if the response indicates an error status * @throws IOException if an I/O error occurs during the HTTP request * @throws InterruptedException if the operation is interrupted