feat: js/py generate declarations from comments (#30)
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user