From 005d23030dab2b7708996e779dc78dd5f8ebdb8d Mon Sep 17 00:00:00 2001 From: sigoden Date: Wed, 5 Jun 2024 18:37:52 +0800 Subject: feat: adjust project structure (#16) --- tools/py/may_execute_py_code.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 tools/py/may_execute_py_code.py (limited to 'tools/py') diff --git a/tools/py/may_execute_py_code.py b/tools/py/may_execute_py_code.py new file mode 100644 index 0000000..01a59b9 --- /dev/null +++ b/tools/py/may_execute_py_code.py @@ -0,0 +1,21 @@ +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"]) -- cgit v1.2.3