diff options
Diffstat (limited to 'scripts/run-agent.py')
| -rwxr-xr-x | scripts/run-agent.py | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/scripts/run-agent.py b/scripts/run-agent.py index 9367ea5..7458869 100755 --- a/scripts/run-agent.py +++ b/scripts/run-agent.py @@ -94,14 +94,11 @@ def load_env(file_path): def run(agent_name, agent_path, agent_func, agent_data): - try: - spec = importlib.util.spec_from_file_location( - os.path.basename(agent_path), agent_path - ) - mod = importlib.util.module_from_spec(spec) - spec.loader.exec_module(mod) - except: - raise Exception(f"Unable to load agent tools at '{agent_path}'") + spec = importlib.util.spec_from_file_location( + os.path.basename(agent_path), agent_path + ) + mod = importlib.util.module_from_spec(spec) + spec.loader.exec_module(mod) if not hasattr(mod, agent_func): raise Exception(f"Not module function '{agent_func}' at '{agent_path}'") |
