from typing import Callable
from typing import Tuple
from typing import Mapping
import inspect


def get_function_parameters(
    f: Callable,
) -> Tuple[Mapping[str, inspect.Parameter], type]:
    """
    Returns function's signature as parameters and the output type.

    :param f: the function
    :return: the parameters and the output type
    :raises: ValueError: if the function is a builtin function or method

    :Example:

    >>> def f(a: int, b: int) -> int:
    >>>     return a + b
    >>> get_function_parameters(f)
    (mappingproxy({'a': <Parameter "a:int">, 'b': <Parameter "b:int">}), int)
    """
    sign = inspect.signature(f)
    return sign.parameters, sign.return_annotation