feat: js/py generate declarations from comments (#30)

This commit is contained in:
sigoden
2024-06-07 15:16:31 +08:00
committed by GitHub
parent 2b07fc2c7e
commit 739a832d87
14 changed files with 717 additions and 272 deletions
+6 -21
View File
@@ -1,21 +1,6 @@
def declarate():
return {
"name": "may_execute_py_code",
"description": "Runs the python code.",
"parameters": {
"type": "object",
"properties": {
"code": {
"type": "string",
"description": "Python code to execute, such as `print(\"hello world\")`"
}
},
"required": [
"code"
]
}
}
def execute(data):
exec(data["code"])
def main(code: str):
"""Runs the python code.
Args:
code: Python code to execute, such as `print("hello world")`
"""
exec(code)