Improve static tools initialization safety (#324)
* improve static tools initialization safety * Allow modification of custom_tools during code execution
This commit is contained in:
parent
7e9f6e5edb
commit
b351a8c9ce
|
@ -1266,10 +1266,8 @@ def evaluate_python_code(
|
||||||
|
|
||||||
if state is None:
|
if state is None:
|
||||||
state = {}
|
state = {}
|
||||||
if static_tools is None:
|
static_tools = static_tools.copy() if static_tools is not None else {}
|
||||||
static_tools = {}
|
custom_tools = custom_tools if custom_tools is not None else {}
|
||||||
if custom_tools is None:
|
|
||||||
custom_tools = {}
|
|
||||||
result = None
|
result = None
|
||||||
global PRINT_OUTPUTS
|
global PRINT_OUTPUTS
|
||||||
PRINT_OUTPUTS = ""
|
PRINT_OUTPUTS = ""
|
||||||
|
|
Loading…
Reference in New Issue