MCPcopy
hub / github.com/Fosowl/agenticSeek / load_json_file

Method load_json_file

sources/memory.py:117–132  ·  view source on GitHub ↗

Load a JSON file.

(self, path: str)

Source from the content-addressed store, hash-verified

115 self.logger.warning(f"Error saving file {path}: {e}")
116
117 def load_json_file(self, path: str) -> dict:
118 """Load a JSON file."""
119 json_memory = {}
120 try:
121 with open(path, 'r') as f:
122 json_memory = json.load(f)
123 except FileNotFoundError:
124 self.logger.warning(f"File not found: {path}")
125 return {}
126 except json.JSONDecodeError:
127 self.logger.warning(f"Error decoding JSON from file: {path}")
128 return {}
129 except Exception as e:
130 self.logger.warning(f"Error loading file {path}: {e}")
131 return {}
132 return json_memory
133
134 def load_memory(self, agent_type: str = "casual_agent") -> None:
135 """Load the memory from the last session."""

Callers 1

load_memoryMethod · 0.95

Calls 1

warningMethod · 0.80

Tested by

no test coverage detected