import
statement safe. Additionally,
we have modified the variable matching logic and introduced the
:obj:fuzz_state
for fuzzy matching.
Modifications copyright (C) 2023 CAMEL-AI.org
Parameters:
action_space
is derived from EmbodiedAgent, representing the actions that an agent is capable of performing. If None
, set to empty dict. (default: :obj:None
).
). (default: :obj:None
)True
, the interpreter runs the code by eval()
or exec()
without any security check. (default: :obj:False
)False
)True
, safe built-in functions like print, len, str, etc. are added to the action space. (default: :obj:True
)unsafe_mode
is
set to False
, the code is executed in a controlled environment using
the execute
method. If unsafe_mode
is True
, the code is executed
using eval()
or exec()
with the action space as the global context.
An InterpreterError
is raised if the code type is unsupported or if
any runtime error occurs during execution.
Parameters:
python
, py
, python3
, python2
). (default: obj:python
)None
)fuzz_state
has a variable :obj:image
, the generated code can use :obj:input_image
to access it. (default: :obj:None
)True
, :obj:state
and :obj:fuzz_state
will be kept for later execution. Otherwise, they will be cleared. (default: :obj:True
)state
and :obj:fuzz_state
.