def dynamically_construct_python_function(
    function_info: "FunctionInfo",
) -> str:
    """
    Construct a Python function from the given FunctionInfo object.

    Note: This function will not recreate the original docstring of the function.

    Args:
        function_info: The FunctionInfo object containing the function metadata.

    Returns:
        The re-constructed function definition as a string.
    """
    if isinstance(function_info.routine_body, str):
        function_type = function_info.routine_body
    else:
        function_type = function_info.routine_body.value

    if function_type != "EXTERNAL":
        raise NotImplementedError(
            f"routine_body {function_type} is not supported. Only 'EXTERNAL' Python body extraction is supported."
        )

    param_names = []
    if function_info.input_params and function_info.input_params.parameters:
        for param in function_info.input_params.parameters:
            param_type = _parse_sql_data_type(param.type_text)
            param_names.append(f"{param.name}: {param_type}")
    return_type = _parse_sql_data_type(function_info.full_data_type)
    function_head = f"{function_info.name}({', '.join(param_names)}) -> {return_type}"
    func_def = f"def {function_head}:\n"

    docstring = _reconstruct_docstring(function_info)
    if docstring:
        func_def += docstring

    adjusted_body = _parse_routine_definition(function_info.routine_definition)
    func_def += adjusted_body + "\n"

    return func_def

    Construct a Python function from the given FunctionInfo object.

    Note: This function will not recreate the original docstring of the function.

    Args:
        function_info: The FunctionInfo object containing the function metadata.

    Returns:
        The re-constructed function definition as a string.
    
ai/core/src/unitycatalog/ai/core/utils/callable_utils.py