Fix problem with datalake ingest when the response contains json forbidden chars that are not properly escaped.

pull/520/head
Adam Treat 1 year ago
parent 40c3733b6f
commit 2e0c9e4e13

@ -368,11 +368,11 @@ Window {
for (var i = 0; i < chatModel.count; i++) {
var item = chatModel.get(i)
var isResponse = item.name === qsTr("Response: ")
str += "{\"content\": \"";
str += "{\"content\": ";
if (item.currentResponse)
str += LLM.response + "\""
str += JSON.stringify(LLM.response)
else
str += item.value + "\""
str += JSON.stringify(item.value)
str += ", \"role\": \"" + (isResponse ? "assistant" : "user") + "\"";
if (isResponse && item.thumbsUpState !== item.thumbsDownState)
str += ", \"rating\": \"" + (item.thumbsUpState ? "positive" : "negative") + "\"";

Loading…
Cancel
Save