annaban / echo_loop.py
Faucetfan's picture
Upload 32 files
de8e64f verified
raw
history blame contribute delete
697 Bytes
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.")