Ollama4j
A Java library (wrapper/binding) for Ollama server.
Loading...
Searching...
No Matches
OllamaChatResult.java
Go to the documentation of this file.
1package io.github.ollama4j.models.chat;
2
3import java.util.List;
4
5import io.github.ollama4j.models.response.OllamaResult;
6
11public class OllamaChatResult extends OllamaResult{
12
13 private List<OllamaChatMessage> chatHistory;
14
15 public OllamaChatResult(String response, long responseTime, int httpStatusCode,
16 List<OllamaChatMessage> chatHistory) {
17 super(response, responseTime, httpStatusCode);
18 this.chatHistory = chatHistory;
19 appendAnswerToChatHistory(response);
20 }
21
22 public List<OllamaChatMessage> getChatHistory() {
23 return chatHistory;
24 }
25
26 private void appendAnswerToChatHistory(String answer){
28 this.chatHistory.add(assistantMessage);
29 }
30
31
32}
OllamaChatResult(String response, long responseTime, int httpStatusCode, List< OllamaChatMessage > chatHistory)