mirror of
https://github.com/legop3/MultiRoombaRover.git
synced 2026-09-16 17:40:46 -04:00
remove prior bot messages from the info
This commit is contained in:
@@ -281,14 +281,15 @@ function buildSnapshot() {
|
|||||||
text: entry.text || '',
|
text: entry.text || '',
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const botRecent = getRecentMessages(80, { includeSystem: true })
|
// Temporarily disabled: do not feed prior bot/system messages into the LLM snapshot.
|
||||||
.filter((entry) => Number(entry?.ts) >= contextResetAt)
|
// const botRecent = getRecentMessages(80, { includeSystem: true })
|
||||||
.filter((entry) => entry?.system)
|
// .filter((entry) => Number(entry?.ts) >= contextResetAt)
|
||||||
.slice(-MAX_BOT_MESSAGES)
|
// .filter((entry) => entry?.system)
|
||||||
.map((entry) => ({
|
// .slice(-MAX_BOT_MESSAGES)
|
||||||
ts_iso: new Date(entry.ts).toISOString(),
|
// .map((entry) => ({
|
||||||
text: entry.text || '',
|
// ts_iso: new Date(entry.ts).toISOString(),
|
||||||
}));
|
// text: entry.text || '',
|
||||||
|
// }));
|
||||||
|
|
||||||
return {
|
return {
|
||||||
now: {
|
now: {
|
||||||
@@ -303,7 +304,7 @@ function buildSnapshot() {
|
|||||||
},
|
},
|
||||||
rovers,
|
rovers,
|
||||||
chat_recent: chatRecent,
|
chat_recent: chatRecent,
|
||||||
bot_recent_messages: botRecent,
|
// bot_recent_messages: botRecent,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -431,7 +432,10 @@ async function runTick() {
|
|||||||
updateStatus({
|
updateStatus({
|
||||||
lastGeneratedText: text,
|
lastGeneratedText: text,
|
||||||
});
|
});
|
||||||
const recentBotMessages = snapshot.bot_recent_messages || [];
|
const recentBotMessages = getRecentMessages(80, { includeSystem: true })
|
||||||
|
.filter((entry) => Number(entry?.ts) >= contextResetAt)
|
||||||
|
.filter((entry) => entry?.system)
|
||||||
|
.slice(-MAX_BOT_MESSAGES);
|
||||||
const duplicate = recentBotMessages.some(
|
const duplicate = recentBotMessages.some(
|
||||||
(entry) => String(entry?.text || '').trim().toLowerCase() === text.toLowerCase(),
|
(entry) => String(entry?.text || '').trim().toLowerCase() === text.toLowerCase(),
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user