AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
Merge branch 'master' into shellcommands
Bernhard Mueller959867918094
diff --cc scripts/commands.pyindex 267138319b,073ecc56a9..0e49b7a3b3--- a/scripts/commands.py+++ b/scripts/commands.py@@@ -104,13 -106,10 +106,15 @@@ def execute_command(command_name, argumreturn ai.write_tests(arguments["code"], arguments.get("focus"))elif command_name == "execute_python_file": # Add this commandreturn execute_python_file(arguments["file"])+ elif command_name == "exec_shell":+ if cfg.execute_local_commands:+ return exec_shell(arguments["command_line"])+ else:+ return "You are not allowed to run local shell commands. To execute shell commands, EXECUTE_SHELL_COMMANDS must be set to 'True' in your config. Do not attempt to bypass the restriction."elif command_name == "generate_image":return generate_image(arguments["prompt"])+ elif command_name == "do_nothing":+ return "No action performed."elif command_name == "task_complete":shutdown()else:diff --cc scripts/data/prompt.txtindex f8043496fb,fc68f3ae0d..4484108b70--- a/scripts/data/prompt.txt+++ b/scripts/data/prompt.txt@@@ -22,9 -22,9 +22,10 @@@ COMMANDS16. Get Improved Code: "improve_code", args: "suggestions": "<list_of_suggestions>", "code": "<full_code_string>"17. Write Tests: "write_tests", args: "code": "<full_code_string>", "focus": "<list_of_focus_areas>"18. Execute Python File: "execute_python_file", args: "file": "<file>"-19. Task Complete (Shutdown): "task_complete", args: "reason": "<reason>"-20. Generate Image: "generate_image", args: "prompt": "<prompt>"-21. Do Nothing: "do_nothing", args: ""+19. Execute Shell Command, non-interactive commands only: "exec_shell", args: "command_line": "<command_line>".+20. Task Complete (Shutdown): "task_complete", args: "reason": "<reason>"+21. Generate Image: "generate_image", args: "prompt": "<prompt>"++22. Do Nothing: "do_nothing", args: ""RESOURCES:diff --cc scripts/execute_code.pyindex 3aa50bc894,a8f909116e..b803d3baae--- a/scripts/execute_code.py+++ b/scripts/execute_code.py@@@ -7,8 -3,10 +7,9 @@@ WORKSPACE_FOLDER = "auto_gpt_workspacedef execute_python_file(file):+ """Execute a Python file in a Docker container and return the output"""- workspace_folder = "auto_gpt_workspace"- print (f"Executing file '{file}' in workspace '{workspace_folder}'")+ print (f"Executing file '{file}' in workspace '{WORKSPACE_FOLDER}'")if not file.endswith(".py"):return "Error: Invalid file type. Only .py files are allowed."