CodeExecutionToolkit
- sandbox (str): The environment type used to execute code. (default:
subprocess
) - verbose (bool): Whether to print the output of the code execution. (default: :obj:
False
) - unsafe_mode (bool): If
True
, the interpreter runs the code byeval()
without any security check. (default: :obj:False
) - import_white_list (Optional[List[str]]): A list of allowed imports. (default: :obj:
None
) - require_confirm (bool): Whether to require confirmation before executing code. (default: :obj:
False
) - timeout (Optional[float]): General timeout for toolkit operations. (default: :obj:
None
) - microsandbox_config (Optional[dict]): Configuration for microsandbox interpreter. Available keys: ‘server_url’, ‘api_key’, ‘namespace’, ‘sandbox_name’, ‘timeout’. If None, uses default configuration. (default: :obj:
None
)
init
execute_code
- code (str): The input code to the Code Interpreter tool call.
- code_type (str): The type of the code to be executed (e.g. node.js, python, etc). (default: obj:
python
)
execute_command
- command (str): The command to execute.