Skip to content

Commit

Permalink
when resetting chat, restore original prompt. close #2585
Browse files Browse the repository at this point in the history
  • Loading branch information
j-dimension committed Sep 28, 2024
1 parent b9f2fb3 commit 8388a04
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -740,6 +740,8 @@ public class AssistantChatDialog extends javax.swing.JDialog {

// cache incoming and outgoing messages
private List<Message> messages = new ArrayList<>();

private String initialPrompt="";

/**
* Creates new form GenericAssistantDialog
Expand Down Expand Up @@ -813,6 +815,7 @@ public AssistantChatDialog(ArchiveFileBean selectedCase, AssistantConfig config,
String promptWithValues = TemplatesUtil.replacePlaceHolders(c.getDefaultPrompt().getDefaultPrompt(), placeHolders);
this.taPrompt.setText(promptWithValues);
}
this.initialPrompt=this.taPrompt.getText();
this.taPrompt.setEnabled(true);
} else {
this.taPrompt.setEnabled(false);
Expand Down Expand Up @@ -1297,6 +1300,7 @@ private void cmdInterruptActionPerformed(java.awt.event.ActionEvent evt) {//GEN-
private void cmdResetChatActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cmdResetChatActionPerformed
this.messages.clear();
this.pnlMessages.removeAll();
this.taPrompt.setText(this.initialPrompt);
ComponentUtils.bumpSplitPane(splitInputOutput);

}//GEN-LAST:event_cmdResetChatActionPerformed
Expand Down

0 comments on commit 8388a04

Please sign in to comment.