<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add_param_annotations( logic: Callable, params: List[RequestParamAnnotation]) -> Callable: """Adds parameter annotations to a logic function. This adds additional required and/or optional parameters to the logic function that are not part of it's signature. It's intended to be used by decorators decorating logic functions or middleware. :param logic: The logic function to add the parameter annotations to. :param params: The list of RequestParamAnnotations to add to the logic func. :returns: The logic func with updated parameter annotations. """

    # If we've already added param annotations to this function get the
    # values from the logic, otherwise we need to inspect it.
    if hasattr(logic, '_doctor_signature'):
        sig = logic._doctor_signature
        doctor_params = logic._doctor_params
    else:
        sig = inspect.signature(logic)
        doctor_params = get_params_from_func(logic, sig)

    prev_parameters = {name: param for name, param in sig.parameters.items()}
    new_params = []
    for param in params:
        # If the parameter already exists in the function signature, log
        # a warning and skip it.
        if param.name in prev_parameters:
            logging.warning('Not adding %s to signature of %s, function '
                            'already has that parameter in its signature.',
                            param.name, logic.__name__)
            continue
        doctor_params.all.append(param.name)
        default = None
        if param.required:
            default = Parameter.empty
            doctor_params.required.append(param.name)
        else:
            doctor_params.optional.append(param.name)
        new_params.append(
            Parameter(param.name, Parameter.KEYWORD_ONLY, default=default,
                      annotation=param.annotation))

    new_sig = sig.replace(
        parameters=list(prev_parameters.values()) + new_params)
    logic._doctor_signature = new_sig
    logic._doctor_params = doctor_params
    return logic