forked from Mirror/ollama4j
Do not append to history
This commit is contained in:
parent
bb0785140b
commit
613e152e7d
@ -16,16 +16,10 @@ public class OllamaChatResult extends OllamaResult{
|
|||||||
List<OllamaChatMessage> chatHistory) {
|
List<OllamaChatMessage> chatHistory) {
|
||||||
super(response, responseTime, httpStatusCode);
|
super(response, responseTime, httpStatusCode);
|
||||||
this.chatHistory = chatHistory;
|
this.chatHistory = chatHistory;
|
||||||
appendAnswerToChatHistory(response);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<OllamaChatMessage> getChatHistory() {
|
public List<OllamaChatMessage> getChatHistory() {
|
||||||
return chatHistory;
|
return chatHistory;
|
||||||
}
|
|
||||||
|
|
||||||
private void appendAnswerToChatHistory(String answer){
|
|
||||||
OllamaChatMessage assistantMessage = new OllamaChatMessage(OllamaChatMessageRole.ASSISTANT, answer);
|
|
||||||
this.chatHistory.add(assistantMessage);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user