@@ -37,10 +37,11 @@ Rectangle {
37
37
38
38
Connections {
39
39
target: currentChat
40
- function onResponseInProgressChanged () {
41
- if (MySettings .networkIsActive && ! currentChat .responseInProgress )
42
- Network .sendConversation (currentChat .id , getConversationJson ());
43
- }
40
+ // FIXME: https://github.com/nomic-ai/gpt4all/issues/3334
41
+ // function onResponseInProgressChanged() {
42
+ // if (MySettings.networkIsActive && !currentChat.responseInProgress)
43
+ // Network.sendConversation(currentChat.id, getConversationJson());
44
+ // }
44
45
function onModelLoadingErrorChanged () {
45
46
if (currentChat .modelLoadingError !== " " )
46
47
modelLoadingErrorPopup .open ()
@@ -116,42 +117,44 @@ Rectangle {
116
117
}
117
118
}
118
119
119
- function getConversation () {
120
- var conversation = " " ;
121
- for (var i = 0 ; i < chatModel .count ; i++ ) {
122
- var item = chatModel .get (i)
123
- var string = item .name ;
124
- var isResponse = item .name === " Response: "
125
- string += chatModel .get (i).value
126
- if (isResponse && item .stopped )
127
- string += " <stopped>"
128
- string += " \n "
129
- conversation += string
130
- }
131
- return conversation
132
- }
133
-
134
- function getConversationJson () {
135
- var str = " {\" conversation\" : [" ;
136
- for (var i = 0 ; i < chatModel .count ; i++ ) {
137
- var item = chatModel .get (i)
138
- var isResponse = item .name === " Response: "
139
- str += " {\" content\" : " ;
140
- str += JSON .stringify (item .value )
141
- str += " , \" role\" : \" " + (isResponse ? " assistant" : " user" ) + " \" " ;
142
- if (isResponse && item .thumbsUpState !== item .thumbsDownState )
143
- str += " , \" rating\" : \" " + (item .thumbsUpState ? " positive" : " negative" ) + " \" " ;
144
- if (isResponse && item .newResponse !== " " )
145
- str += " , \" edited_content\" : " + JSON .stringify (item .newResponse );
146
- if (isResponse && item .stopped )
147
- str += " , \" stopped\" : \" true\" "
148
- if (! isResponse)
149
- str += " },"
150
- else
151
- str += ((i < chatModel .count - 1 ) ? " }," : " }" )
152
- }
153
- return str + " ]}"
154
- }
120
+ // FIXME: https://github.com/nomic-ai/gpt4all/issues/3334
121
+ // function getConversation() {
122
+ // var conversation = "";
123
+ // for (var i = 0; i < chatModel.count; i++) {
124
+ // var item = chatModel.get(i)
125
+ // var string = item.name;
126
+ // var isResponse = item.name === "Response: "
127
+ // string += chatModel.get(i).value
128
+ // if (isResponse && item.stopped)
129
+ // string += " <stopped>"
130
+ // string += "\n"
131
+ // conversation += string
132
+ // }
133
+ // return conversation
134
+ // }
135
+
136
+ // FIXME: https://github.com/nomic-ai/gpt4all/issues/3334
137
+ // function getConversationJson() {
138
+ // var str = "{\"conversation\": [";
139
+ // for (var i = 0; i < chatModel.count; i++) {
140
+ // var item = chatModel.get(i)
141
+ // var isResponse = item.name === "Response: "
142
+ // str += "{\"content\": ";
143
+ // str += JSON.stringify(item.value)
144
+ // str += ", \"role\": \"" + (isResponse ? "assistant" : "user") + "\"";
145
+ // if (isResponse && item.thumbsUpState !== item.thumbsDownState)
146
+ // str += ", \"rating\": \"" + (item.thumbsUpState ? "positive" : "negative") + "\"";
147
+ // if (isResponse && item.newResponse !== "")
148
+ // str += ", \"edited_content\": " + JSON.stringify(item.newResponse);
149
+ // if (isResponse && item.stopped)
150
+ // str += ", \"stopped\": \"true\""
151
+ // if (!isResponse)
152
+ // str += "},"
153
+ // else
154
+ // str += ((i < chatModel.count - 1) ? "}," : "}")
155
+ // }
156
+ // return str + "]}"
157
+ // }
155
158
156
159
ChatDrawer {
157
160
id: chatDrawer
@@ -932,10 +935,7 @@ Rectangle {
932
935
visible: false
933
936
}
934
937
onClicked: {
935
- var conversation = getConversation ()
936
- copyEdit .text = conversation
937
- copyEdit .selectAll ()
938
- copyEdit .copy ()
938
+ chatModel .copyToClipboard ()
939
939
copyMessage .open ()
940
940
}
941
941
ToolTip .visible : copyChatButton .hovered
@@ -1354,9 +1354,10 @@ Rectangle {
1354
1354
ToolTip .text : Accessible .description
1355
1355
1356
1356
onClicked: {
1357
- var index = Math .max (0 , chatModel .count - 1 );
1358
- var listElement = chatModel .get (index);
1359
- listElement .stopped = true
1357
+ // FIXME: This no longer sets a 'stopped' field so conversations that
1358
+ // are copied to clipboard or to datalake don't indicate if the user
1359
+ // has prematurely stopped the response. This has been broken since
1360
+ // v3.0.0 at least.
1360
1361
currentChat .stopGenerating ()
1361
1362
}
1362
1363
}
0 commit comments