From a7c7a5e18b7f3670ac2a66434764e8181cb11f77 Mon Sep 17 00:00:00 2001 From: Reinier van der Leer Date: Tue, 30 Apr 2024 15:26:41 +0200 Subject: [PATCH] fix(agent): Fix `execute_python_file` on local storage It's still broken for remote/cloud storage. --- autogpts/autogpt/autogpt/commands/execute_code.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/autogpts/autogpt/autogpt/commands/execute_code.py b/autogpts/autogpt/autogpt/commands/execute_code.py index b9365b2c..515f2d60 100644 --- a/autogpts/autogpt/autogpt/commands/execute_code.py +++ b/autogpts/autogpt/autogpt/commands/execute_code.py @@ -164,8 +164,8 @@ class CodeExecutorComponent(CommandProvider): if not str(filename).endswith(".py"): raise InvalidArgumentError("Invalid file type. Only .py files are allowed.") - file_path = Path(filename) - if not file_path.is_file(): + file_path = self.workspace.get_path(filename) + if not self.workspace.exists(file_path): # Mimic the response that you get from the command line to make it # intuitively understandable for the LLM raise FileNotFoundError(