Skip to main content

Module code_exec

Module code_exec 

Source
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.

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 via tokio::process.

Structs§

CodeExecutionInput
Inputs to one execution.
CodeExecutionResult
Output of one execution.
ExecFile
One file passed to or returned from an executor.

Traits§

CodeExecutor
Pluggable executor for ExecutableCode parts.