Skip to content

Commit

Permalink
fixed repeated answers to the same questions. message history was inc…
Browse files Browse the repository at this point in the history
…omplete (assistant replies missing). close #2675
  • Loading branch information
j-dimension committed Nov 16, 2024
1 parent ba4f00c commit 263845b
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1147,7 +1147,7 @@ protected Void doInBackground() throws Exception {
ClientSettings settings = ClientSettings.getInstance();

Message incomingMsg = new Message();
incomingMsg.setRole("assistant");
incomingMsg.setRole(Message.ROLE_ASSISTANT);
incomingMsg.setContent("...");
AiChatMessagePanel incomingMsgPanel = new AiChatMessagePanel(incomingMsg, owner);
try {
Expand Down Expand Up @@ -1244,6 +1244,7 @@ protected void done() {
}
AiChatMessagePanel msgPanel = incomingMessageRef.get();
msgPanel.getMessage().setContent(resultString.toString());
messages.add(msgPanel.getMessage());
msgPanel.setMessage(msgPanel.getMessage(), owner);
msgPanel.repaint();
msgPanel.updateUI();
Expand Down

0 comments on commit 263845b

Please sign in to comment.