Do not append to history

This commit is contained in:
Sebastiaan de Schaetzen 2024-05-27 16:53:01 +02:00
parent 992625cf86
commit d32a8b7d88

View File

@ -16,16 +16,10 @@ public class OllamaChatResult extends OllamaResult{
List<OllamaChatMessage> chatHistory) {
super(response, responseTime, httpStatusCode);
this.chatHistory = chatHistory;
appendAnswerToChatHistory(response);
}
public List<OllamaChatMessage> getChatHistory() {
return chatHistory;
}
private void appendAnswerToChatHistory(String answer){
OllamaChatMessage assistantMessage = new OllamaChatMessage(OllamaChatMessageRole.ASSISTANT, answer);
this.chatHistory.add(assistantMessage);
}