Decisions and confidence
All decisions in a workflow run in one provider call. Each result keeps both the normalized answer and the raw answer.
Decision primitives
Section titled “Decision primitives”| Primitive | Definition | Value |
|---|---|---|
one_of |
Two or more named options with descriptions |
Chosen option name |
whether |
A yes/no question |
true when P(true) ≥ 0.5 |
scale |
Two or more ordered levels |
Expected position, zero-based, can be fractional |
decisions: urgent: decide: whether question: Does this ticket need immediate attention? severity: decide: scale question: How severe is the customer impact? levels: - negligible - minor - significant - criticalWith four levels, severity.value is anywhere from 0 to 3, such as 1.7.
Metadata
Section titled “Metadata”Rules can read value, probability, confidence and accepted where available.
whether.probabilityis always P(true), even when the value isfalse.scalehas noprobability.- Laya’s
whetherhas noconfidence; useprobability.
Reading a field the backend didn’t supply raises an error.
Confidence policies
Section titled “Confidence policies”decisions: department: decide: one_of question: Which team should handle this ticket? options: billing: Payments and invoices support: Product problems confidence: minimum: 0.75flow: - when: department.accepted == false do: return value: route: human_review - else: do: return value: route: "{{ department.value }}"accepted is true when confidence ≥ minimum. Missing confidence fails the policy. Without a policy, accepted is always true.
A policy doesn’t retry or reroute; your rules decide what happens. Pick thresholds from representative data.
Model limits
Section titled “Model limits”Keep inputs and option lists short. Laya’s English checkpoint has a 512-token window, including question headers. See the Laya project.