diff options
Diffstat (limited to 'tools/may_execute_py_code.py')
| -rw-r--r-- | tools/may_execute_py_code.py | 27 |
1 files changed, 6 insertions, 21 deletions
diff --git a/tools/may_execute_py_code.py b/tools/may_execute_py_code.py index 01a59b9..8e55a8d 100644 --- a/tools/may_execute_py_code.py +++ b/tools/may_execute_py_code.py @@ -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) |
