def METHOD_NAME(dialog_context, hypotheses, human_uttr_attributes):
    try:
        ie_types = [
            "external service" if hyp["skill_name"] in EXTERNAL_SKILLS else "internal service" for hyp in hypotheses
        ]
        if "transformers" in GENERATIVE_SERVICE_URL:
            curr_prompt = (
                "Hypotheses:\n"
                + "\n".join([f'"{hyp["text"]}" [{ie}]' for hyp, ie in zip(hypotheses, ie_types)])
                + "\n"
                + PROMPT
            )
        else:
            curr_prompt = (
                PROMPT
                + "\nHypotheses:\n"
                + "\n".join([f'"{hyp["text"]}" [{ie}]' for hyp, ie in zip(hypotheses, ie_types)])
            )
        logger.info(f"llm_based_response_selector sends dialog context to llm:\n`{dialog_context}`")
        logger.info(f"llm_based_response_selector sends prompt to llm:\n`{curr_prompt}`")
        lm_service_kwargs = human_uttr_attributes.pop("lm_service_kwargs", None)
        lm_service_kwargs = {} if lm_service_kwargs is None else lm_service_kwargs
        envvars_to_send = ENVVARS_TO_SEND if len(ENVVARS_TO_SEND) else human_uttr_attributes.get("envvars_to_send", [])
        sending_variables = compose_sending_variables(
            lm_service_kwargs,
            envvars_to_send,
            **human_uttr_attributes,
        )
        response = send_request_to_prompted_generative_service(
            dialog_context,
            curr_prompt,
            GENERATIVE_SERVICE_URL,
            GENERATIVE_SERVICE_CONFIG,
            GENERATIVE_TIMEOUT,
            sending_variables,
        )
        result = response[0]
    except Exception as e:
        sentry_sdk.capture_exception(e)
        logger.exception(e)
        result = select_response_by_scores(hypotheses, [hyp["confidence"] for hyp in hypotheses])[0]
        logger.info("Exception in LLM's invocation. Selected a response with the highest confidence.")
    logger.info(f"llm_based_response_selector selected:\n`{result}`")
    return result