execute
Execute the function with the given arguments. Calls the handler and normalizes the return value into a serialized result dictionary.
Parameters
args
Parsed arguments for the function, matching the parameter schema.
rawData
Full raw request data including global_data, call_id, caller_id_number,
meta_data, and ai_session_id.
Returns
Promise<Record<string, unknown>> — The function result as a dictionary (from
FunctionResult.toDict()). If the handler throws an exception, returns a
generic error message rather than exposing internal details.
The handler can return a FunctionResult, an object with a "response" key,
or a plain string. All formats are normalized to a result dictionary.