fix bot reply loop #2
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user