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, List<OllamaChatMessage> chatHistory) {
16 super(response, responseTime, httpStatusCode);
17 this.chatHistory = chatHistory;
18 appendAnswerToChatHistory(response);
19 }
20
21 public List<OllamaChatMessage> getChatHistory() {
22 return chatHistory;
23 }
24
25 private void appendAnswerToChatHistory(String answer) {
27 this.chatHistory.add(assistantMessage);
28 }
29}
OllamaChatResult(String response, long responseTime, int httpStatusCode, List< OllamaChatMessage > chatHistory)