Skip to main content

Module decided

Module decided 

Source
Expand description

The decided guard atom: a guard on what a decision model concluded about the conversation, rather than on a state key something else wrote.

A question is declared once (see crate::decision::Decisions); a guard names it and what it expects:

JSONHolds when
{"decided": "confirmed"}a boolean was answered yes, a choice picked an option, a score was given
{"decided": {"confirmed": false}}a boolean was answered no, or a choice picked “none of these”
{"decided": {"next_step": "book"}}a choice picked book
{"decided": {"frustration": {"at_least": 2}}}a score of 2 or more
{"decided": {"frustration": {"at_most": 1}}}a score of 1 or less

The runtime asks the questions the flow can act on at each decision point (the caller’s turn ends, or the model calls a tool) and records each answer under decision:{id} with the caller turn it was about. An answer counts only for that turn: a yes given three turns ago does not satisfy a guard now, so nothing has to be latched or cleared. An unsure answer satisfies no expectation.

Structs§

Decided
A guard on a decision: the question’s id and what is expected.
DecisionRecord
An answer as recorded in state under decision_key.

Enums§

Expect
What a decided guard expects of an answer.
Outcome
How an answer came out.

Constants§

DECISION_PREFIX
Prefix of the state keys answers are recorded under.
DECISION_TURN_KEY
The state key holding the caller turn answers are currently about.

Functions§

decision_key
The state key an answer to question is recorded under.