feat: enable complex agent instructions and save user messages for learning

This commit is contained in:
2025-11-08 01:35:14 +00:00
parent 89e12683de
commit 98f7847686
4 changed files with 16 additions and 6 deletions
+4 -2
View File
@@ -1,17 +1,19 @@
import os
from pathlib import Path
from typing import Optional
CONTEXT_FILE = "/home/retoor/.local/share/rp/.rcontext.txt"
CONTEXT_FILE = Path.home() / ".local" / "share" / "rp" / ".rcontext.txt"
def _read_context() -> str:
if not os.path.exists(CONTEXT_FILE):
if not CONTEXT_FILE.exists():
raise FileNotFoundError(f"Context file {CONTEXT_FILE} not found.")
with open(CONTEXT_FILE, "r") as f:
return f.read()
def _write_context(content: str):
CONTEXT_FILE.parent.mkdir(parents=True, exist_ok=True)
with open(CONTEXT_FILE, "w") as f:
f.write(content)