Spaces:
Runtime error
Runtime error
| 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" | |