Skip to content

Commit

Permalink
Add write_file
Browse files Browse the repository at this point in the history
  • Loading branch information
SmartManoj committed Mar 1, 2025
1 parent fab189c commit 0516b30
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion sandbox_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ def read_file(path):
}
}

def write_file(path, content):
return {
'action': {
'action': 'write',
'args': {'path': path, 'content': content},
}
}

def execute_action(data, timeout=5):
data = json.dumps(data)
for k in [1, 2]:
Expand Down Expand Up @@ -77,4 +85,5 @@ def execute_action(data, timeout=5):
)
# execute_action(run_ipython('open_file'))
execute_action(run('pwd'))
execute_action(read_file('.openhands_instructions'))
execute_action(write_file('test', 'hello'))
execute_action(read_file('test'))

0 comments on commit 0516b30

Please sign in to comment.