VirtualKimi commited on
Commit
c7438a1
·
verified ·
1 Parent(s): bcbb712

Upload kimi-module.js

Browse files
Files changed (1) hide show
  1. kimi-js/kimi-module.js +7 -3
kimi-js/kimi-module.js CHANGED
@@ -557,7 +557,7 @@ async function loadChatHistory() {
557
  const recent = await kimiDB.getRecentConversations(10);
558
 
559
  if (recent.length === 0) {
560
- const greeting = kimiMemory.getGreeting();
561
  addMessageToChat("kimi", greeting);
562
  } else {
563
  recent.forEach(conv => {
@@ -567,11 +567,11 @@ async function loadChatHistory() {
567
  }
568
  } catch (error) {
569
  console.error("Error while loading history:", error);
570
- const greeting = kimiMemory.getGreeting();
571
  addMessageToChat("kimi", greeting);
572
  }
573
  } else {
574
- const greeting = kimiMemory.getGreeting();
575
  addMessageToChat("kimi", greeting);
576
  }
577
  }
@@ -1322,6 +1322,10 @@ async function sendMessage() {
1322
  if (messageObj && messageObj.updateText) {
1323
  messageObj.updateText(finalResponse);
1324
  }
 
 
 
 
1325
  }
1326
 
1327
  // Voice synthesis after streaming completes (if not started during streaming)
 
557
  const recent = await kimiDB.getRecentConversations(10);
558
 
559
  if (recent.length === 0) {
560
+ const greeting = await kimiMemory.getGreeting();
561
  addMessageToChat("kimi", greeting);
562
  } else {
563
  recent.forEach(conv => {
 
567
  }
568
  } catch (error) {
569
  console.error("Error while loading history:", error);
570
+ const greeting = await kimiMemory.getGreeting();
571
  addMessageToChat("kimi", greeting);
572
  }
573
  } else {
574
+ const greeting = await kimiMemory.getGreeting();
575
  addMessageToChat("kimi", greeting);
576
  }
577
  }
 
1322
  if (messageObj && messageObj.updateText) {
1323
  messageObj.updateText(finalResponse);
1324
  }
1325
+ } else {
1326
+ if (messageObj && messageObj.updateText) {
1327
+ messageObj.updateText(finalResponse);
1328
+ }
1329
  }
1330
 
1331
  // Voice synthesis after streaming completes (if not started during streaming)