Collect parameters into a schema
Arguments
- ...
hr_param()objects. Their order is the orderhr_validate()resolves them in, so a bound that depends on another parameter comes after it.
Examples
s <- hr_schema(
hr_param("max_tokens", "integer", default = 1200L, min = 32, max = 1e6),
hr_param("overlap_tokens", "integer", default = 0L, min = 0,
max = function(p) p$max_tokens - 1L))
suppressWarnings(hr_validate(s, list(max_tokens = 100, overlap_tokens = 500)))
#> $max_tokens
#> [1] 100
#>
#> $overlap_tokens
#> [1] 99
#>