def METHOD_NAME(
    self,
    model: Union["pl.LightningModule", Module],
    optimizer: Steppable,
    clip_val: Optional[Union[int, float]] = None,
    gradient_clip_algorithm: Optional[GradClipAlgorithmType] = None,
) -> None:
    if not isinstance(model, pl.LightningModule) or not model.automatic_optimization:
        # the configuration validator disallows clipping on manual
        return
    call._call_lightning_module_hook(
        model.trainer,
        "configure_gradient_clipping",
        optimizer,
        gradient_clip_val=clip_val,
        gradient_clip_algorithm=gradient_clip_algorithm,
    )