Code Executor (autogen.coding ) | Environment | Platform |
---|---|---|
LocalCommandLineCodeExecutor | Shell | Local |
DockerCommandLineCodeExecutor | Shell | Docker |
jupyter.JupyterCodeExecutor | Jupyter Kernel (e.g., python3) | Local/Docker |
autogen.coding.LocalCommandLineCodeExecutor
).
matplotlib
and numpy
are installed.
human_input_mode="ALWAYS"
to manually validate the safety of the code being executed.
autogen.coding.DockerCommandLineCodeExecutor
) to execute code in a docker container.
This way, the generated code can only access resources that are explicitly given to it.
The figure below illustrates how docker execution works.
work_dir
in the constructor points to a local file system directory just like in the local execution case.
The docker container will mount this directory and the executor write code files and output to it.
system_message
. The system message contains important instruction on how to use the code executor in the code executor agent.