fix(agent): Fix `execute_python_file` on local storage

It's still broken for remote/cloud storage.
pull/7021/head
Reinier van der Leer 2024-04-30 15:26:41 +02:00
parent 180de0c9a9
commit a7c7a5e18b
No known key found for this signature in database
GPG Key ID: CDC1180FDAE06193
1 changed files with 2 additions and 2 deletions

View File

@ -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(