def generate_wrapped_function_info(
    primary_func: Callable[..., Any], functions: list[Callable[..., Any]]
) -> FunctionInfoDefinition:
    """
    Generates a FunctionInfoDefinition object for a primary function and its wrapped functions.

    This object encapsulates all necessary information about the primary function and in-lines the wrapped functions into the primary function's definition.

    Args:
        primary_func: The primary Python function to generate information for.
        functions: List of wrapped functions to be in-lined into the primary function.

    Returns:
        An object containing detailed information about the primary function and its wrapped functions.
    """

    wrapped_function_content = extract_wrapped_functions(functions)

    primary_metadata = extract_function_metadata(primary_func)

    primary_metadata.function_body = (
        wrapped_function_content + "\n" + primary_metadata.function_body
    )

    parameters = create_parameter_info(primary_metadata)

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

    Generates a FunctionInfoDefinition object for a primary function and its wrapped functions.

    This object encapsulates all necessary information about the primary function and in-lines the wrapped functions into the primary function's definition.

    Args:
        primary_func: The primary Python function to generate information for.
        functions: List of wrapped functions to be in-lined into the primary function.

    Returns:
        An object containing detailed information about the primary function and its wrapped functions.
    
ai/core/src/unitycatalog/ai/core/utils/callable_utils_oss.py