import requests


def predict_reaction_batch_on_success(response: requests.models.Response) -> dict:
    """
    Process the successful response of requests returning predict reaction batch results.

    Args:
        response (requests.models.Response): response from an API request.

    Returns:
        dict: dictionary representing the response.
    """
    response_dict = response.json()
    identifier = response_dict["payload"]["task"]["task_id"]
    status = response_dict["payload"]["task"]["status"]
    return_dict = {}
    if status == "DONE":
        return response_dict["payload"]["result"]
    elif status == "WAITING":
        return_dict['message'] = (
            'Task waiting: either the task is submitted and not running or it does not exists in the queue.'
        )
    return_dict['task_id'] = identifier
    return_dict['task_status'] = status
    return return_dict