From de650985212967f01d952e36387e61f60fc0102f Mon Sep 17 00:00:00 2001 From: Slipstream Date: Wed, 30 Apr 2025 12:40:36 -0600 Subject: [PATCH] aa --- gurt/background.py | 2 +- gurt_memory.py | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/gurt/background.py b/gurt/background.py index d2e7283..970c35f 100644 --- a/gurt/background.py +++ b/gurt/background.py @@ -567,7 +567,7 @@ async def background_processing_task(cog: 'GurtCog'): "should_follow_up": {"type": "boolean", "description": "Whether Gurt should perform a follow-up action based on the previous action's result."}, "reasoning": {"type": "string", "description": "Brief reasoning for the follow-up decision."}, "follow_up_tool_name": {"type": ["string", "null"], "description": "If following up, the name of the tool to use (e.g., 'send_discord_message', 'remember_general_fact'). Null otherwise."}, - "follow_up_arguments": {"type": ["object", "null"], "description": "If following up, arguments for the follow-up tool. Null otherwise."} + "follow_up_arguments": {"type": ["object", "null"], "description": "If following up, arguments for the follow_up tool. Null otherwise."} }, "required": ["should_follow_up", "reasoning"] } diff --git a/gurt_memory.py b/gurt_memory.py index 573f32a..fe491bf 100644 --- a/gurt_memory.py +++ b/gurt_memory.py @@ -225,6 +225,27 @@ class MemoryManager: logger.info("Goals table created/verified.") # --- End Goals Table --- + # Add ALTER TABLE statements here to ensure columns exist + try: + # Check if guild_id column exists + cursor = await db.execute("PRAGMA table_info(gurt_goals)") + columns = await cursor.fetchall() + column_names = [column[1] for column in columns] + + if 'guild_id' not in column_names: + logger.info("Adding guild_id column to gurt_goals table") + await db.execute("ALTER TABLE gurt_goals ADD COLUMN guild_id TEXT") + if 'channel_id' not in column_names: + logger.info("Adding channel_id column to gurt_goals table") + await db.execute("ALTER TABLE gurt_goals ADD COLUMN channel_id TEXT") + if 'user_id' not in column_names: + logger.info("Adding user_id column to gurt_goals table") + await db.execute("ALTER TABLE gurt_goals ADD COLUMN user_id TEXT") + + except Exception as e: + logger.error(f"Error checking/adding columns to gurt_goals table: {e}", exc_info=True) + + # --- Add Internal Actions Log Table --- await db.execute(""" CREATE TABLE IF NOT EXISTS internal_actions (