From 613e152e7d737e49fa404285eeef2aee1f8999af Mon Sep 17 00:00:00 2001 From: Sebastiaan de Schaetzen Date: Mon, 27 May 2024 16:53:01 +0200 Subject: [PATCH] Do not append to history --- .../ollama4j/core/models/chat/OllamaChatResult.java | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/chat/OllamaChatResult.java b/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/chat/OllamaChatResult.java index 6ac6578..68ad8de 100644 --- a/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/chat/OllamaChatResult.java +++ b/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/chat/OllamaChatResult.java @@ -16,16 +16,10 @@ public class OllamaChatResult extends OllamaResult{ List chatHistory) { super(response, responseTime, httpStatusCode); this.chatHistory = chatHistory; - appendAnswerToChatHistory(response); } public List getChatHistory() { return chatHistory; - } - - private void appendAnswerToChatHistory(String answer){ - OllamaChatMessage assistantMessage = new OllamaChatMessage(OllamaChatMessageRole.ASSISTANT, answer); - this.chatHistory.add(assistantMessage); }