Update sources/memory.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Martin 2025-05-05 19:00:49 +02:00 committed by GitHub
parent de2650c007
commit dd033d4084
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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: