-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathmemory_probe.py
More file actions
23 lines (20 loc) · 768 Bytes
/
memory_probe.py
File metadata and controls
23 lines (20 loc) · 768 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import json
def main():
try:
with open("/home/frost/.gemini/memory/events.jsonl", "r") as f:
lines = f.readlines()
last_five = lines[-5:]
for line in last_five:
try:
event = json.loads(line)
print(f"Timestamp: {event['timestamp']}, Event Type: {event['event_type']}")
except json.JSONDecodeError:
print(f"Error decoding JSON: {line.strip()}")
except KeyError:
print(f"Missing key in event: {line.strip()}")
except FileNotFoundError:
print("Error: Memory file not found.")
except Exception as e:
print(f"An error occurred: {e}")
if __name__ == "__main__":
main()