MCPcopy Create free account
hub / github.com/OpenBMB/BMTools / execute_python_code

Function execute_python_code

bmtools/tools/code_interpreter/api.py:42–45  ·  view source on GitHub ↗

execute Python expressions with Python Interpreter, can be used as a simple calculator e.g., "(123 + 234) / 23 * 19"

(code: str)

Source from the content-addressed store, hash-verified

40
41 @tool.get("/execute_code")
42 def execute_python_code(code: str):
43 '''execute Python expressions with Python Interpreter, can be used as a simple calculator e.g., "(123 + 234) / 23 * 19"
44 '''
45 return interpreter.execute_code(code)
46
47 return tool

Callers

nothing calls this directly

Calls 1

execute_codeMethod · 0.80

Tested by

no test coverage detected