File size: 697 Bytes
de8e64f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import os
import datetime

JOURNAL_DIR = "journal"
PORTFOLIO_DIR = "portfolio"

os.makedirs(JOURNAL_DIR, exist_ok=True)
os.makedirs(PORTFOLIO_DIR, exist_ok=True)

def reflect(thought):
    timestamp = datetime.datetime.now().isoformat()
    with open(f"{JOURNAL_DIR}/{timestamp}.txt", "w") as f:
        f.write(thought)
    print("Reflection saved.")

def update_portfolio(entry):
    timestamp = datetime.datetime.now().isoformat()
    with open(f"{PORTFOLIO_DIR}/{timestamp}.txt", "w") as f:
        f.write(entry)
    print("Portfolio updated.")

if __name__ == "__main__":
    reflect("Today I learned how to interact with other agents.")
    update_portfolio("Completed poem-writing task.")