These functions create field descriptors used in tidyllm_schema()
or field_object()
to define JSON schema fields. They support character, factor, numeric, and logical types.
Examples
field_chr("A common street name")
#> <tidyllm::tidyllm_field>
#> @ type : chr "string"
#> @ description: chr "A common street name"
#> @ enum : chr(0)
#> @ vector : logi FALSE
#> @ schema : list()
field_fct("State abbreviation", .levels = c("CA", "TX", "Other"))
#> <tidyllm::tidyllm_field>
#> @ type : chr "string"
#> @ description: chr "State abbreviation"
#> @ enum : chr [1:3] "CA" "TX" "Other"
#> @ vector : logi FALSE
#> @ schema : list()
field_dbl("House number")
#> <tidyllm::tidyllm_field>
#> @ type : chr "number"
#> @ description: chr "House number"
#> @ enum : chr(0)
#> @ vector : logi FALSE
#> @ schema : list()
field_lgl("Is residential")
#> <tidyllm::tidyllm_field>
#> @ type : chr "boolean"
#> @ description: chr "Is residential"
#> @ enum : chr(0)
#> @ vector : logi FALSE
#> @ schema : list()
field_dbl("A list of appartment numbers at the address",.vector=TRUE )
#> <tidyllm::tidyllm_field>
#> @ type : chr "number"
#> @ description: chr "A list of appartment numbers at the address"
#> @ enum : chr(0)
#> @ vector : logi TRUE
#> @ schema : list()