def METHOD_NAME(model_name: str, response: Dict, req_attributes: Dict,
                               binary_event=False) -> tuple:
    ce_attributes = {}
    if os.getenv("CE_MERGE", "false").lower() == "true":
        if binary_event:
            ce_attributes = req_attributes
            if "datacontenttype" in ce_attributes:  # Optional field so must check
                del ce_attributes["datacontenttype"]
        else:
            ce_attributes = req_attributes
        # Remove these fields so we generate new ones
        del ce_attributes["id"]
        del ce_attributes["time"]
    ce_attributes["type"] = os.getenv("CE_TYPE", "io.kserve.inference.response")
    ce_attributes["source"] = os.getenv("CE_SOURCE", f"io.kserve.inference.{model_name}")
    event = CloudEvent(ce_attributes, response)
    if binary_event:
        event_headers, event_body = to_binary(event)
    else:
        event_headers, event_body = to_structured(event)
    return event_headers, event_body