feat: enable complex agent instructions and save user messages for learning
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user