pub fn compileFunctionOutput(
function: JsValue,
input: JsValue,
task_outputs: JsValue,
) -> Result<JsValue, JsValue>Expand description
Computes the final output of a Function given input and task results.
Evaluates the function’s output expression using the provided input data and task outputs. Also validates that the output meets constraints:
- Scalar functions: output must be in [0, 1]
- Vector functions: output must sum to approximately 1
§Arguments
function- JavaScript object representing a Function definitioninput- JavaScript object representing the function inputtask_outputs- Array of task outputs (from actual execution or mocked)
§Returns
An object with:
output: The computed scalar or vector outputvalid: Boolean indicating if the output meets constraints
§Errors
Returns an error string if expression evaluation fails.