#[non_exhaustive]pub enum Question {
#[non_exhaustive] Noul {
instructions: Value,
criteria: Option<NoulCriteria>,
},
#[non_exhaustive] Choice {
instructions: Value,
criteria: BTreeMap<String, Option<String>>,
},
#[non_exhaustive] Score {
instructions: Value,
criteria: Vec<String>,
},
}Expand description
A typed question evaluated against the request state.
instructions may be a string, object or array. Reference nested state with
backticked paths such as `rows[3].country`. Construct through the associated
functions (Question::noul, Question::choice, Question::score) or the
SystemOneRequest builder; the variants are
#[non_exhaustive] so fields can follow the API without breaking callers.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
#[non_exhaustive]Noul
Yes/no. Answered with the probability of “yes”.
Fields
This variant is marked as non-exhaustive
criteria: Option<NoulCriteria>What yes and no mean, when spelled out.
#[non_exhaustive]Choice
One option out of a defined set (at most MAX_CHOICE_OPTIONS). Answered with
the chosen option and the probability of every option.
Fields
This variant is marked as non-exhaustive
#[non_exhaustive]Score
A position along an ordered rubric of at least two levels.
Fields
This variant is marked as non-exhaustive
Implementations§
Source§impl Question
impl Question
Sourcepub fn noul(instructions: impl Into<Value>) -> Self
pub fn noul(instructions: impl Into<Value>) -> Self
A yes/no question without criteria descriptions.
Sourcepub fn noul_with_criteria(
instructions: impl Into<Value>,
yes: impl Into<String>,
no: impl Into<String>,
) -> Self
pub fn noul_with_criteria( instructions: impl Into<Value>, yes: impl Into<String>, no: impl Into<String>, ) -> Self
A yes/no question with descriptions of what yes and no mean.
Sourcepub fn choice<K, V>(
instructions: impl Into<Value>,
options: impl IntoIterator<Item = (K, Option<V>)>,
) -> Self
pub fn choice<K, V>( instructions: impl Into<Value>, options: impl IntoIterator<Item = (K, Option<V>)>, ) -> Self
Pick one of options. Each option is (name, optional description).
Sourcepub fn choice_plain<K: Into<String>>(
instructions: impl Into<Value>,
options: impl IntoIterator<Item = K>,
) -> Self
pub fn choice_plain<K: Into<String>>( instructions: impl Into<Value>, options: impl IntoIterator<Item = K>, ) -> Self
Pick one of options, none of which carries a description.