#[non_exhaustive]pub struct UnderstandingInput {
pub message: Words,
pub locale: Locale,
pub today: NaiveDate,
pub transcript: Vec<TranscriptMessage>,
pub workflows: Vec<WorkflowBrief>,
pub card: Option<OpenCard>,
pub expectation: Option<Expectation>,
pub waiting: Vec<PendingAct>,
pub done: Vec<PendingAct>,
pub receipts: Vec<PreviousReceipt>,
pub last_subjects: Vec<TargetToken>,
pub settings: Option<Settings>,
}Expand description
The input of one turn’s understanding.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.message: WordsThe user’s message.
locale: LocaleThe turn’s language.
today: NaiveDateToday, in the user’s time zone: what relative dates count from.
transcript: Vec<TranscriptMessage>The most recent messages before this one, oldest first.
workflows: Vec<WorkflowBrief>The workflows in view, in registration order.
card: Option<OpenCard>The card waiting for an answer.
expectation: Option<Expectation>What the assistant asked for last turn.
waiting: Vec<PendingAct>Acts of earlier turns still waiting for a record the user named that did not exist.
done: Vec<PendingAct>Acts the last turn did, with the values they were given: a correction changes what it says of one and keeps the rest.
receipts: Vec<PreviousReceipt>What the assistant reported doing last turn, so a dispute can name it.
last_subjects: Vec<TargetToken>The records the assistant’s last message was about.
settings: Option<Settings>How this turn is run, over the understander’s own settings.
Implementations§
Source§impl UnderstandingInput
impl UnderstandingInput
Sourcepub fn new(message: &str, locale: impl Into<Locale>, today: NaiveDate) -> Self
pub fn new(message: &str, locale: impl Into<Locale>, today: NaiveDate) -> Self
A turn saying message on today, with nothing else in view.
Sourcepub const fn with_settings(self, settings: Settings) -> Self
pub const fn with_settings(self, settings: Settings) -> Self
Runs this turn under settings instead of the understander’s.
Sourcepub fn with_workflow(self, workflow: WorkflowBrief) -> Self
pub fn with_workflow(self, workflow: WorkflowBrief) -> Self
Adds a workflow.
Sourcepub fn with_earlier(self, speaker: Speaker, text: &str) -> Self
pub fn with_earlier(self, speaker: Speaker, text: &str) -> Self
Adds an earlier message.
Sourcepub fn with_expectation(self, expectation: Expectation) -> Self
pub fn with_expectation(self, expectation: Expectation) -> Self
Sets what the assistant asked for.
Sourcepub fn with_waiting(self, act: PendingAct) -> Self
pub fn with_waiting(self, act: PendingAct) -> Self
Adds an act of an earlier turn still waiting for a record the user named.
Sourcepub fn with_done(self, act: PendingAct) -> Self
pub fn with_done(self, act: PendingAct) -> Self
Adds an act the last turn did.
Sourcepub fn with_receipt(self, receipt: PreviousReceipt) -> Self
pub fn with_receipt(self, receipt: PreviousReceipt) -> Self
Adds a receipt of the last turn.
Sourcepub fn with_last_subject(self, record: TargetToken) -> Self
pub fn with_last_subject(self, record: TargetToken) -> Self
Adds a record the assistant’s last message was about.
Sourcepub fn workflow(&self, key: &WorkflowKey) -> Option<&WorkflowBrief>
pub fn workflow(&self, key: &WorkflowKey) -> Option<&WorkflowBrief>
The workflow with this key.
Sourcepub fn operation(
&self,
key: &OperationKey,
) -> Option<(&WorkflowBrief, &OperationSpec)>
pub fn operation( &self, key: &OperationKey, ) -> Option<(&WorkflowBrief, &OperationSpec)>
The operation with this key, and its workflow.
Sourcepub fn record(
&self,
token: &TargetToken,
) -> Option<(&WorkflowBrief, &RecordBrief)>
pub fn record( &self, token: &TargetToken, ) -> Option<(&WorkflowBrief, &RecordBrief)>
The record with this token, and its workflow.