forked from Mirror/ollama4j
Do not append to history
This commit is contained in:
parent
992625cf86
commit
d32a8b7d88
@ -16,17 +16,11 @@ 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