From 263845bc255055f3f71249e1f8eb7ea5d0f0978b Mon Sep 17 00:00:00 2001 From: j-dimension Date: Sun, 17 Nov 2024 00:08:40 +0100 Subject: [PATCH] fixed repeated answers to the same questions. message history was incomplete (assistant replies missing). close #2675 --- .../jlawyer/client/assistant/AssistantChatDialog.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/j-lawyer-client/src/com/jdimension/jlawyer/client/assistant/AssistantChatDialog.java b/j-lawyer-client/src/com/jdimension/jlawyer/client/assistant/AssistantChatDialog.java index 5030d361f..80e550dbc 100644 --- a/j-lawyer-client/src/com/jdimension/jlawyer/client/assistant/AssistantChatDialog.java +++ b/j-lawyer-client/src/com/jdimension/jlawyer/client/assistant/AssistantChatDialog.java @@ -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 { @@ -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();