aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/run-tool.py
diff options
context:
space:
mode:
authorsigoden <sigoden@gmail.com>2025-02-10 14:47:37 +0800
committerGitHub <noreply@github.com>2025-02-10 14:47:37 +0800
commitfad2c60605b67a44dc6d242cd99f6f79f1bd4b13 (patch)
tree1e09d16e378c273ad2d3668e329c80aeaf6d741c /scripts/run-tool.py
parente4f85a056cdd2081374e3923af660942363f1133 (diff)
downloadllm-functions-docker-fad2c60605b67a44dc6d242cd99f6f79f1bd4b13.tar.gz
refactor: improve run-agent/run-agent scripts (#160)
Diffstat (limited to 'scripts/run-tool.py')
-rwxr-xr-xscripts/run-tool.py13
1 files changed, 5 insertions, 8 deletions
diff --git a/scripts/run-tool.py b/scripts/run-tool.py
index f0f2917..590125c 100755
--- a/scripts/run-tool.py
+++ b/scripts/run-tool.py
@@ -89,14 +89,11 @@ def load_env(file_path):
def run(tool_name, tool_path, tool_func, tool_data):
- try:
- spec = importlib.util.spec_from_file_location(
- os.path.basename(tool_path), tool_path
- )
- mod = importlib.util.module_from_spec(spec)
- spec.loader.exec_module(mod)
- except:
- raise Exception(f"Unable to load tool at '{tool_path}'")
+ spec = importlib.util.spec_from_file_location(
+ os.path.basename(tool_path), tool_path
+ )
+ mod = importlib.util.module_from_spec(spec)
+ spec.loader.exec_module(mod)
if not hasattr(mod, tool_func):
raise Exception(f"Not module function '{tool_func}' at '{tool_path}'")