View source: R/02_S7_prop_factories.R
| prop_string | R Documentation |
Empty and whitespace-only strings are rejected by default: an unset value is
NULL, so "" reaching a property is almost always a mistake rather than a
deliberate empty name. Pass allow_empty = TRUE where it is meaningful.
prop_string(
default = NULL,
enum = NULL,
nullable = FALSE,
vector = FALSE,
map = FALSE,
min_items = 1L,
unique_items = FALSE,
allow_empty = FALSE,
description = ""
)
default |
Character: Default value (NULL for none, or if |
enum |
Character or NULL: Allowed values. |
nullable |
Logical: If TRUE, NULL is a valid value. |
vector |
Logical: If TRUE, the value is vector-valued (a JSON array). |
map |
Logical: If TRUE, the value is a named vector (a JSON object
with string values). Mutually exclusive with |
min_items |
Integer: Fewest elements a |
unique_items |
Logical: If TRUE, a |
allow_empty |
Logical: If TRUE, |
description |
Character: Human-readable description. |
S7 property.
EDG
model_name <- prop_string(description = "Model name")
backend <- prop_string(default = "ollama", enum = c("ollama", "openai"))
api_key <- prop_string(nullable = TRUE, description = "API key")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.