Skip to main content

orchestrate_local

One-shot local execution of a code string in the Monty sandbox.

def orchestrate_local(
source: str,
inputs: Dict[str, Any],
tasks: Optional[List[Any]] = None,
timeout_ms: int = 30_000
) - > Any

One-shot local execution of a code string in the Monty sandbox. Sends the code + inputs to Monty and returns the result directly, without creating a TaskTemplate or going through the controller. The last expression in source becomes the return value.

Parameters

NameTypeDescription
sourcestrPython code string to execute in the sandbox.
inputsDict[str, Any]Mapping of input names to their values.
tasksOptional[List[Any]] = NoneList of external functions (tasks, durable ops) available inside the sandbox. Each item's __name__ is used as the key.
timeout_msint = 30_000Sandbox execution timeout in milliseconds.

Returns

TypeDescription
AnyThe result of the executed code string.