Syntax error?

This commit is contained in:
AllfatherHatt 2025-02-23 12:17:55 +01:00
parent d699b537e3
commit 8a54890f56

View File

@ -113,12 +113,9 @@ class ReginaldCog(commands.Cog):
memory.append({"user": "Reginald", "content": response_text}) memory.append({"user": "Reginald", "content": response_text})
# ✅ Compute dynamic values for summarization and retention # ✅ Compute dynamic values for summarization and retention
messages_to_summarize = int(self.short_term_memory_limit * self.summary_retention_rati messages_to_summarize = int(self.short_term_memory_limit * self.summary_retention_ratio)
o)
messages_to_retain = self.short_term_memory_limit - messages_to_summarize messages_to_retain = self.short_term_memory_limit - messages_to_summarize
MINIMUM_SHORT_TERM_MESSAGES = 10
messages_to_retain = max(messages_to_retain, MINIMUM_SHORT_TERM_MESSAGES)
# ✅ Check if pruning is needed # ✅ Check if pruning is needed
if len(memory) > self.short_term_memory_limit: if len(memory) > self.short_term_memory_limit:
summary = await self.summarize_memory(ctx, memory[:messages_to_summarize]) summary = await self.summarize_memory(ctx, memory[:messages_to_summarize])