def generate_function_info(func: Callable[..., Any]) -> FunctionInfoDefinition:
    """
    Generates a FunctionInfoDefinition object for a given Python function.

    This object encapsulates all necessary information about the function,
    including its name, definition, data types, parameters, and comments,
    which can be used for integration with Unity Catalog.

    Args:
        func: The Python function to generate information for.

    Returns:
        An object containing detailed information about the function.
    """

    metadata = extract_function_metadata(func)

    parameters = create_parameter_info(metadata)

    return FunctionInfoDefinition(
        callable_name=metadata.func_name,
        routine_definition=metadata.function_body,
        data_type=metadata.base_return_type_name,
        full_data_type=metadata.sql_return_type,
        parameters=parameters,
        comment=metadata.docstring_info.description,
    )

    Generates a FunctionInfoDefinition object for a given Python function.

    This object encapsulates all necessary information about the function,
    including its name, definition, data types, parameters, and comments,
    which can be used for integration with Unity Catalog.

    Args:
        func: The Python function to generate information for.

    Returns:
        An object containing detailed information about the function.
    
ai/core/src/unitycatalog/ai/core/utils/callable_utils_oss.py