mirror of
https://github.com/carlrobertoh/ProxyAI.git
synced 2026-05-24 05:44:32 +00:00
Replace last message on response regeneration #51
This commit is contained in:
parent
ad3196afb1
commit
1b312da9ab
4 changed files with 37 additions and 13 deletions
|
|
@ -33,11 +33,19 @@ public class ToolWindowService implements LafManagerListener {
|
|||
return chatToolWindow;
|
||||
}
|
||||
|
||||
public void startRequest(String prompt, SyntaxTextArea textArea, Project project) {
|
||||
public void startRequest(String prompt, SyntaxTextArea textArea, Project project, boolean isRetry) {
|
||||
var conversationsState = ConversationsState.getInstance();
|
||||
var currentConversation = ConversationsState.getCurrentConversation();
|
||||
var conversation = currentConversation == null ? conversationsState.startConversation() : currentConversation;
|
||||
var conversationMessage = new Message(prompt);
|
||||
|
||||
Message conversationMessage;
|
||||
if (isRetry) {
|
||||
var messages = conversation.getMessages();
|
||||
conversationMessage = messages.get(messages.size() - 1);
|
||||
conversationMessage.setResponse("");
|
||||
} else {
|
||||
conversationMessage = new Message(prompt);
|
||||
}
|
||||
|
||||
new SwingWorker<Void, String>() {
|
||||
protected Void doInBackground() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue