Susi-Chromebot is one the Susi enabled Chrome extensions with Susi-Ai enabled.
People can message and susi responds with a response from Susi-Skill in skills.susi.ai
It fixes this issue
There was no sync between messages sent via chromebot and other clients of Susi.
For eg. If a user has a chat history in Susi Mobile app, the chat history should also be present in chromebot.
https://api.susi.ai/susi/memory.json?access_token=${accessToken};Not that good.brain.exe And some Bad Bad implementation of codefunction retrieveChatHistory() {
var serverHistoryEndpoint = BASE_URL + "/susi/memory.json?access_token=" + accessToken;
$.ajax({
url: serverHistoryEndpoint,
dataType: "jsonp",
jsonpCallback: "u",
jsonp: "callback",
crossDomain: "true",
success: function(response) {
var messages = [];
for (var i = response.cognitions.length - 1; i >= 0; i--) {
var queryAnswerPair = response.cognitions[i];
var queryTimes = new Date(Date.parse(queryAnswerPair.query_date));
var answerTimes = new Date(Date.parse(queryAnswerPair.answer_date));
var queryInside = queryAnswerPair.query;
var answerInside = queryAnswerPair;
var msgObj = {
query: queryInside,
answer: answerInside,
queryTime: queryTimes,
answerTime: answerTimes
}
messages.push(msgObj);
localStorage.setItem("messages", JSON.stringify(messages));
}
}
});
}