Skip to content

Commit 07c7d10

Browse files
committed
implement run_ipython
1 parent 7222d31 commit 07c7d10

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

openhands/runtime/impl/local/local_runtime.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,13 @@ def run(self, action: CmdRunAction) -> Observation:
162162
return obs
163163

164164
def run_ipython(self, action: IPythonRunCellAction) -> Observation:
165+
code = action.code
166+
imports = 'from openhands.runtime.plugins.agent_skills.agentskills import *'
167+
with open('/tmp/code.py', 'w') as f:
168+
f.write(imports + '\n' + code)
169+
content = os.popen('poetry run python /tmp/code.py').read()
165170
return IPythonRunCellObservation(
166-
'Not implemented. Please use <execute_bash> only to run code for now.',
171+
content,
167172
action.code,
168173
)
169174

0 commit comments

Comments
 (0)