mirror of
https://github.com/nomic-ai/gpt4all.git
synced 2025-09-04 18:11:02 +00:00
chatmodel: remove the 'prompt' field from ChatItem (#3016)
Signed-off-by: Adam Treat <treat.adam@gmail.com>
This commit is contained in:
@@ -1694,19 +1694,21 @@ Rectangle {
|
||||
imageHeight: 20
|
||||
visible: chatModel.count && !currentChat.isServer && currentChat.isModelLoaded && !currentChat.responseInProgress
|
||||
onClicked: {
|
||||
var index = Math.max(0, chatModel.count - 1);
|
||||
var listElement = chatModel.get(index);
|
||||
if (chatModel.count < 2)
|
||||
return
|
||||
var promptIndex = chatModel.count - 2
|
||||
var promptElement = chatModel.get(promptIndex)
|
||||
var responseIndex = chatModel.count - 1
|
||||
var responseElement = chatModel.get(responseIndex)
|
||||
if (promptElement.name !== "Prompt: " || responseElement.name !== "Response: ")
|
||||
return
|
||||
currentChat.regenerateResponse()
|
||||
if (chatModel.count) {
|
||||
if (listElement.name === "Response: ") {
|
||||
chatModel.updateCurrentResponse(index, true);
|
||||
chatModel.updateStopped(index, false);
|
||||
chatModel.updateThumbsUpState(index, false);
|
||||
chatModel.updateThumbsDownState(index, false);
|
||||
chatModel.updateNewResponse(index, "");
|
||||
currentChat.prompt(listElement.prompt)
|
||||
}
|
||||
}
|
||||
chatModel.updateCurrentResponse(responseIndex, true)
|
||||
chatModel.updateStopped(responseIndex, false)
|
||||
chatModel.updateThumbsUpState(responseIndex, false)
|
||||
chatModel.updateThumbsDownState(responseIndex, false)
|
||||
chatModel.updateNewResponse(responseIndex, "")
|
||||
currentChat.prompt(promptElement.value)
|
||||
}
|
||||
ToolTip.visible: regenerateButton.hovered
|
||||
ToolTip.text: qsTr("Redo last chat response")
|
||||
|
Reference in New Issue
Block a user