Readonly[A unique symbol to identify BaseCodeExecutor class.
The list of the enclosing delimiters to identify the code blocks.
For example, the delimiter('javascript\\n', '\\n') can be used to
identify code blocks with the following format:
console.log("hello")
The number of attempts to retry on consecutive code execution errors. Default to 2.
The delimiters to format the code execution result.
If true, extract and process data files from the model request and attach them to the code executor.
Supported data file MimeTypes are [text/csv]. Default to false.
Whether the code executor is stateful. Default to false.
Stops and removes the container. Safe to call when no container has been started; provided for deterministic teardown in tests and app shutdown.
Executes code and return the code execution result.
The parameters for executing code.
The result of the code execution.
A code executor that runs model-generated code inside a hardened Docker container via the
dockerodeclient.Security note: this executor runs model-generated code, which may be influenced by untrusted input (e.g. via prompt injection). By default the container is started with networking disabled and all Linux capabilities dropped so the executed code cannot reach the network (including the cloud metadata endpoint at
169.254.169.254) or escalate privileges. Networking can be re-enabled vianetworkEnabled: truewhen the executed code is trusted.Limitations: this executor runs a code string only.
inputFilesandargson the request are not copied into the container, and output files are not collected (outputFilesis always empty), so tools that stage resource files or read artifacts back (e.g.RunSkillScriptTool) are not yet supported. Sending files in and out viaputArchive/getArchiveis future work.