From 4dbee1d99053856482b307c5a4beb90a09297eed Mon Sep 17 00:00:00 2001 From: AllfatherHatt Date: Tue, 25 Feb 2025 21:24:55 +0100 Subject: [PATCH] More fix --- reginaldCog/reginald.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/reginaldCog/reginald.py b/reginaldCog/reginald.py index d6a2bcc..6a09f19 100644 --- a/reginaldCog/reginald.py +++ b/reginaldCog/reginald.py @@ -173,6 +173,8 @@ class ReginaldCog(commands.Cog): memory.append({"user": user_name, "content": prompt}) memory.append({"user": "Reginald", "content": response_text}) + summary = None # ✅ Always define it first + if len(memory) > SHORT_TERM_LIMIT: summary = await self.summarize_memory(message, memory[:int(SHORT_TERM_LIMIT * SUMMARY_RETENTION_RATIO)])