Skip to content

Commit

Permalink
Changes python version to 3.10 in execute_code.
Browse files Browse the repository at this point in the history
  • Loading branch information
Torantulino committed Apr 3, 2023
1 parent c9be6ed commit f426b51
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion scripts/execute_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
def execute_python_file(file):
workspace_folder = "auto_gpt_workspace"

print (f"Executing file '{file}' in workspace '{workspace_folder}'")

if not file.endswith(".py"):
return "Error: Invalid file type. Only .py files are allowed."

Expand All @@ -20,7 +22,7 @@ def execute_python_file(file):
# You can find available Python images on Docker Hub:
# https://hub.docker.com/_/python
container = client.containers.run(
'python:3.8',
'python:3.10',
f'python {file}',
volumes={
os.path.abspath(workspace_folder): {
Expand All @@ -36,6 +38,9 @@ def execute_python_file(file):
logs = container.logs().decode('utf-8')
container.remove()

# print(f"Execution complete. Output: {output}")
# print(f"Logs: {logs}")

return logs

except Exception as e:
Expand Down

0 comments on commit f426b51

Please sign in to comment.