Expand description
Code-execution subsystem (feature = "code-exec").
Lets agents emit ExecutableCode parts and have the runtime run the
code in a sandbox of varying degrees of safety.
local::LocalCodeExecutor— spawns a child interpreter viatokio::processwith a timeout. Local subprocess isolation only — not a security boundary.docker::ContainerCodeExecutor(feature = "code-exec-docker") — spins up an ephemeral Docker container per call.
The runner extracts ExecutableCode parts from model responses, invokes
the agent’s executor, and feeds back CodeExecutionResult parts. Attach
an executor via LlmAgent::builder().code_executor(...).
Modules§
- docker
ContainerCodeExecutor— runs code in a fresh ephemeral Docker container per call.- local
LocalCodeExecutor— runs code in a local subprocess viatokio::process.
Structs§
- Code
Execution Input - Inputs to one execution.
- Code
Execution Result - Output of one execution.
- Exec
File - One file passed to or returned from an executor.
Traits§
- Code
Executor - Pluggable executor for
ExecutableCodeparts.