from upsonic import DeepAgent, Task
agent = DeepAgent("openai/gpt-4o")
# Add initial files
agent.add_file("/app/main.py", "print('Hello World')")
agent.add_file("/app/requirements.txt", "flask==2.0.1")
# Or set multiple files at once
agent.set_files({
"/project/README.md": "# My Project",
"/project/src/main.py": "def main():\n print('Hello')"
})
# Get all files
files = agent.get_files()
# Returns: {"/app/main.py": "...", "/app/requirements.txt": "..."}
task = Task("Review the code and add error handling")
result = agent.do(task)