import requests


def _get_predictions(model_endpoint: str, input_text: str, use_gazetteers: bool = True):
    """
    Asks the container pointed by model_endpoint for predictions.
    :param model_endpoint:
    :param input_text:
    :param use_gazetteers:
    :return:
    """
    headers = {'Content-Type': 'application/json'}
    body = {
        'text': input_text
    }
    r = requests.post(model_endpoint, headers=headers, json=body)
    if not r.ok:
        message = 'Something went wrong: the docker container {} did not answer'.format(model_endpoint)
        raise SystemError(message)
    return r.json()