Skip to content

Commit 24b8a7b

Browse files
refactor: avoid using temp files in sandbox.
1 parent 8bfce62 commit 24b8a7b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

apps/common/utils/tool_code.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def exec_code(self, code_str, keywords):
100100
result_line = [line for line in lines if line.startswith(_id)]
101101
if not result_line:
102102
raise Exception("No result found.")
103-
result = json.loads(base64.b64decode(result_line[0].split(":", 1)[1]).decode())
103+
result = json.loads(base64.b64decode(result_line[-1].split(":", 1)[1]).decode())
104104
if result.get('code') == 200:
105105
return result.get('data')
106106
raise Exception(result.get('msg'))

0 commit comments

Comments
 (0)