def get_clarifai_response(clarifai_api, clarifai_model, source_link,
    check_video):
    """Compiles a list of tags from Clarifai using the chosen models.
    First checks the value of each item in the models list against a
    dictionary. If the model value provided does not match one of the
    keys in the dictionary below, model value is used in
    clarifai_api.models.get(). Useful for custom models."""
    video_models = ['apparel', 'food', 'general', 'nsfw', 'travel', 'wedding']
    clarifai_models = {'general': 'general-v1.3', 'nsfw': 'nsfw-v1.0',
        'apparel': 'apparel', 'celebrity': 'celeb-v1.3', 'color': 'color',
        'demographics': 'demographics', 'food': 'food-items-v1.0',
        'landscape quality': 'Landscape Quality', 'logo': 'logo',
        'moderation': 'moderation', 'portrait quality': 'Portrait Quality',
        'textures': 'Textures & Patterns', 'travel': 'travel-v1.0',
        'weddings': 'weddings-v1.0'}
    model = clarifai_api.models.get(clarifai_models.get(clarifai_model.
        lower(), clarifai_model))
    if check_video and source_link[0].endswith('mp4') and clarifai_model.lower(
        ) in video_models:
        response = model.predict_by_url(source_link[0], is_video=True)
    elif source_link[0].endswith('mp4'):
        response = model.predict_by_url(source_link[1])
    else:
        response = model.predict_by_url(source_link[0])
    return response
