Adapters
chemistry
biology
legal
music
art
code
climate
medical
Not-For-All-Audiences
Autonomous-AI / goal_manager.py
Leonydis137's picture
Upload 9 files
1ac9488 verified
raw
history blame contribute delete
618 Bytes
import json, os
def save_goal(goal):
os.makedirs("goals", exist_ok=True)
goal_data = {
"goal": goal,
"status": "pending"
}
with open(f"goals/{int(time.time())}.json", "w") as f:
json.dump(goal_data, f)
def list_goals():
goal_files = sorted(os.listdir("goals")) if os.path.exists("goals") else []
goals = []
for gf in goal_files[-10:]: # Show last 10 goals
with open(f"goals/{gf}", "r") as f:
data = json.load(f)
goals.append(f"🎯 {data['goal']} — [{data['status']}]")
return "\n".join(goals) if goals else "No goals yet."