```{r}
#| include: false
get_dials <- function(x) {
  if (any(names(x) == "range")) {
    cl <- rlang::call2(x$fun, .ns = x$pkg, range = x$range)
  } else {
    cl <- rlang::call2(x$fun, .ns = x$pkg)
  }
  rlang::eval_tidy(cl)
}

get_param_list <- function(x) {
  args <- formals(x)
  params <- getS3method("tunable", x)(list()) |>
    dplyr::mutate(
      default = args[name],
      dials = purrr::map(call_info, get_dials),
      label = purrr::map_chr(dials, \(.x) .x$label),
      type = purrr::map_chr(dials, \(.x) .x$type),
      item = glue::glue("- `{name}`: {label} (type: {type}, default: {default})\n\n")
    )

  params$item
}
```

# Tuning Parameters

```{r}
#| echo: false
param <- get_param_list(step)
```

This step has `r length(param)` tuning parameter`r ifelse(length(param) == 1, "", "s")`:

```{r}
#| echo: false
#| results: asis
param
```
