Requirements for Python code generation validation.Documentation Index
Fetch the complete documentation index at: https://docs.mellea.ai/llms.txt
Use this file to discover all available pages before exploring further.
Classes
CLASS PythonExecutionReq
Verifies that Python code runs without raising exceptions.
Extracts the highest-scoring Python code block from the model’s last output
and validates or executes it according to the configured execution mode.
Args:
timeout: Maximum seconds to allow code to run. Defaults to5.allow_unsafe_execution: IfTrue, execute code directly with subprocess. Use only with trusted sources.allowed_imports: Allowlist of importable top-level modules.Noneallows any import.use_sandbox: IfTrue, usellm-sandboxfor Docker-based isolated execution.
validation_fn: The validation function attached to this requirement; always non-None.