aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/build-declarations.py
diff options
context:
space:
mode:
authorsigoden <sigoden@gmail.com>2024-06-07 21:36:34 +0800
committerGitHub <noreply@github.com>2024-06-07 21:36:34 +0800
commit63df67acea19b3708d34ef3b656c1b784c2a72f4 (patch)
tree740ff6c276131898e59bf1495abc238d3fdfb9a7 /scripts/build-declarations.py
parente1d895cc9abb0f7ffac8acc043746cbe2e5f4fe1 (diff)
downloadllm-functions-docker-63df67acea19b3708d34ef3b656c1b784c2a72f4.tar.gz
refactor: numerous improvements (#32)
Diffstat (limited to 'scripts/build-declarations.py')
-rw-r--r--scripts/build-declarations.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/scripts/build-declarations.py b/scripts/build-declarations.py
index 2a28e43..2157c88 100644
--- a/scripts/build-declarations.py
+++ b/scripts/build-declarations.py
@@ -9,8 +9,11 @@ from collections import OrderedDict
TOOL_ENTRY_FUNC = "run"
-def main(is_tool = True):
+
+def main(is_tool=True):
scriptfile = sys.argv[1]
+ is_tool = os.path.dirname(scriptfile) == "tools"
+
with open(scriptfile, "r", encoding="utf-8") as f:
contents = f.read()
@@ -92,8 +95,8 @@ def parse_docstring(docstring: str):
break
params = {}
for rawParam in rawParams:
- name, type_, description = parse_param(rawParam)
- params[name] = (type_, description)
+ name, type_, param_description = parse_param(rawParam)
+ params[name] = (type_, param_description)
return (description.strip(), params)