aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
authorsigoden <sigoden@gmail.com>2024-10-26 08:26:52 +0800
committerGitHub <noreply@github.com>2024-10-26 08:26:52 +0800
commite1a26cb4f2032dfb44908ecb73b9039ca1c7dc04 (patch)
tree7cabfa29d7c5a0ccbbfff822ffb3bd4b607bd563 /README.md
parentfbeaa9cb2c5b7a8e0d9114a62c270c6fe8024c31 (diff)
downloadllm-functions-docker-e1a26cb4f2032dfb44908ecb73b9039ca1c7dc04.tar.gz
refactor: execute js/py code (#118)
Diffstat (limited to 'README.md')
-rw-r--r--README.md8
1 files changed, 4 insertions, 4 deletions
diff --git a/README.md b/README.md
index fff5aa7..df3f0f2 100644
--- a/README.md
+++ b/README.md
@@ -130,8 +130,8 @@ Create a new javascript in the [./tools/](./tools/) directory (.e.g. `execute_js
* @property {string} code - Javascript code to execute, such as `console.log("hello world")`
* @param {Args} args
*/
-exports.main = function main({ code }) {
- return eval(code);
+exports.run = function ({ code }) {
+ eval(code);
}
```
@@ -141,12 +141,12 @@ exports.main = function main({ code }) {
Create a new python script in the [./tools/](./tools/) directory (e.g. `execute_py_code.py`).
```py
-def main(code: str):
+def run(code: str):
"""Execute the python code.
Args:
code: Python code to execute, such as `print("hello world")`
"""
- return exec(code)
+ exec(code)
```