File size: 349 Bytes
f3fe01a
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13

def update_agent_code(new_code):
    with open("agent.py", "w") as f:
        f.write(new_code)
    return "✅ agent.py updated. Rebuild or reload your Space to apply changes."

def read_agent_code():
    try:
        with open("agent.py", "r") as f:
            return f.read()
    except FileNotFoundError:
        return "# agent.py not found"