From 94eada9d5dbac767966e5a8c69a4fca255b0ce23 Mon Sep 17 00:00:00 2001 From: martin legrand Date: Mon, 5 May 2025 19:11:56 +0200 Subject: [PATCH] fix : return for json load --- sources/memory.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sources/memory.py b/sources/memory.py index 6c76fdb..d5df812 100644 --- a/sources/memory.py +++ b/sources/memory.py @@ -118,13 +118,13 @@ class Memory(): json_memory = json.load(f) except FileNotFoundError: self.logger.warning(f"File not found: {path}") - return None + return {} except json.JSONDecodeError: self.logger.warning(f"Error decoding JSON from file: {path}") - return None + return {} except Exception as e: self.logger.warning(f"Error loading file {path}: {e}") - return None + return {} return json_memory def load_memory(self, agent_type: str = "casual_agent") -> None: