def process_function_parameter_defaults(
    function_info: "FunctionInfo", parameters: Optional[dict[str, Any]] = None
) -> dict[str, Any]:
    """
    Handle default values for input parameters.

    Args:
        function_info: The FunctionInfo object containing the function metadata.
        parameters: The parameters to handle.

    Returns:
        The updated parameters with default values filled in.
    """
    defaults = {}
    if function_info.input_params and function_info.input_params.parameters:
        for param in function_info.input_params.parameters:
            if param.parameter_default is not None:
                default_str = param.parameter_default.strip()
                upper_str = default_str.upper()
                # NB: Pydantic requires a NoneType definition to be explicity set directly. If retrieiving
                # this type from a lookup mapping (as is done with True / False as registered in
                # UC_DEFAULT_VALUE_TO_PYTHON_EQUIVALENT_MAPPING), it will not be recognized
                # as a NoneType properly.
                if upper_str == "NULL":
                    defaults[param.name] = None
                elif upper_str in UC_DEFAULT_VALUE_TO_PYTHON_EQUIVALENT_MAPPING:
                    defaults[param.name] = UC_DEFAULT_VALUE_TO_PYTHON_EQUIVALENT_MAPPING[upper_str]
                else:
                    try:
                        defaults[param.name] = ast.literal_eval(default_str)
                    except (ValueError, SyntaxError):
                        try:
                            defaults[param.name] = json.loads(default_str)
                        except json.JSONDecodeError:
                            defaults[param.name] = default_str

    if parameters is None:
        parameters = {}
    return defaults | parameters

    Handle default values for input parameters.

    Args:
        function_info: The FunctionInfo object containing the function metadata.
        parameters: The parameters to handle.

    Returns:
        The updated parameters with default values filled in.
    
ai/core/src/unitycatalog/ai/core/utils/function_processing_utils.py