You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 30, 2023. It is now read-only.
console.error("[LiteGPT] Failed to fetch answer!",e)
- resolve();
+ const stream = simulateStream(genAILikeResponse("Sorry, but i can't communicate with the BAI Chat server to fetch the response at the moment, can you check if your internet connection is working?").map(s => '{"text":"'+s+'"}'),50);
+ stream.read = stream.next;
+ resolve(stream);
fail();
});
return promise;
@@ -395,7 +397,9 @@
if (lastData){
aiChat.innerHTML = formatText(lastData.text);
if (lastData.id) opts.chats[opts.currentChat].id = lastData.id; // set id
- if (!opts.simulateFetch && prompt !== 'hi') opts.chats[opts.currentChat].chat.push({text:lastData.text,isUser:false}); // add response to history
+ if (lastData.text === "" || lastData.text === "Sorry, but i can't communicate with the BAI Chat server to fetch the response at the moment, can you check if your internet connection is working?") {
+ } else if (!opts.simulateFetch && prompt !== 'hi') opts.chats[opts.currentChat].chat.push({text:lastData.text,isUser:false}); // add response to history