diff options
author | Reinier van der Leer <pwuts@agpt.co> | 2024-04-30 15:26:41 +0200 |
---|---|---|
committer | Reinier van der Leer <pwuts@agpt.co> | 2024-04-30 15:26:41 +0200 |
commit | a7c7a5e18b7f3670ac2a66434764e8181cb11f77 (patch) | |
tree | 72466995e0f23759b3a8f5d458a455212b384199 | |
parent | feat(agent/core): Support referenced types in `JSONSchema.from_dict` (diff) | |
download | Auto-GPT-a7c7a5e18b7f3670ac2a66434764e8181cb11f77.tar.gz Auto-GPT-a7c7a5e18b7f3670ac2a66434764e8181cb11f77.tar.bz2 Auto-GPT-a7c7a5e18b7f3670ac2a66434764e8181cb11f77.zip |
fix(agent): Fix `execute_python_file` on local storage
It's still broken for remote/cloud storage.
-rw-r--r-- | autogpts/autogpt/autogpt/commands/execute_code.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/autogpts/autogpt/autogpt/commands/execute_code.py b/autogpts/autogpt/autogpt/commands/execute_code.py index b9365b2c2..515f2d60b 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( |