2025年4月3日18:13:53
parent
61ca638f92
commit
5c86ff4c32
|
|
@ -141,10 +141,10 @@ public class MainController {
|
|||
modelSelector.getValue(),
|
||||
chunk -> {
|
||||
// 在JavaFX线程中更新UI
|
||||
// contentBuilder.append(chunk);
|
||||
contentBuilder.append(chunk);
|
||||
javafx.application.Platform.runLater(() -> {
|
||||
assistantMessage.setContent(contentBuilder.toString());
|
||||
updateMessage(textArea, chunk);
|
||||
updateMessage(textArea, contentBuilder.toString() );
|
||||
});
|
||||
},
|
||||
() -> {
|
||||
|
|
@ -203,12 +203,7 @@ public class MainController {
|
|||
}
|
||||
|
||||
private void updateMessage(TextArea textArea, String content) {
|
||||
if (!textArea.getText().isEmpty()){
|
||||
textArea.appendText(content);
|
||||
}else {
|
||||
textArea.setText(content);
|
||||
}
|
||||
|
||||
textArea.setText(content);
|
||||
}
|
||||
|
||||
private void loadChat(Chat chat) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue