fix bot reply loop #2
Some checks failed
Builds / Discord-Node-Build (push) Has been cancelled
Builds / Discord-Ollama-Container-Build (push) Has been cancelled
Coverage / Discord-Node-Coverage (push) Has been cancelled

This commit is contained in:
2025-05-20 12:21:52 -04:00
parent 194fc57545
commit 3ee8347268

View File

@@ -218,7 +218,7 @@ export default event(Events.MessageCreate, async ({ log, msgHist, ollama, client
log(`Initial sentiments - User ${message.author.id}: ${userSentiment.toFixed(2)}, Bot: ${botSentiment.toFixed(2)}`)
// Construct sentiment data for prompt
const sentimentData = `User ${message.author.id} sentiment: ${userSentiment.toFixed(2)}, Bot sentiment: ${botSentiment.toFixed(2)}`
//const sentimentData = `User ${message.author.id} sentiment: ${userSentiment.toFixed(2)}, Bot sentiment: ${botSentiment.toFixed(2)}`
// Construct prompt with [CHARACTER] and [SENTIMENT]
const prompt = `[CHARACTER]\n${personality}\n[SENTIMENT]\n${sentimentData}\n[USER_INPUT]\n${cleanedMessage}`
@@ -267,6 +267,7 @@ export default event(Events.MessageCreate, async ({ log, msgHist, ollama, client
}
// Execute redis_ops
if (jsonResponse.metadata?.redis_ops) {
for (const op of jsonResponse.metadata.redis_ops) {
try {
const key = op.key.replace('<bot_id>', clientId)