Decisions and confidence
Laya evaluates all decisions in a workflow together in a single model call. Each result preserves the normalized answer and the raw backend answer.
Decision primitives
Section titled “Decision primitives”| Primitive | Definition | Normalized value |
|---|---|---|
one_of |
At least two named options with descriptions |
Selected option name |
whether |
A yes/no question |
Boolean; true when P(true) ≥ 0.5 |
scale |
At least two ordered levels |
Fractional, zero-based expected rubric position |
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 - criticalA scale result can fall between levels. For the four levels above, its value lies between 0 and 3; it is not necessarily an integer label.
Metadata
Section titled “Metadata”Rules can read value, probability, confidence, and accepted where supported. Probability distributions and raw answers are also preserved in execution results.
For whether, probability is P(true), including when the boolean value is false. scale.probability is unavailable. Laya’s whether answers do not provide confidence: compare their probability directly instead.
Reading unavailable metadata raises an error. Do not assume all backends provide every field.
Confidence policies
Section titled “Confidence policies”Add an inclusive threshold to a decision:
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 meets the configured minimum. Missing confidence fails the policy. Without a policy, accepted is true.
A policy does not retry inference, make a second call, or automatically route the result. Your flow decides what happens after a failed policy. Choose thresholds using representative inputs; they are not universal quality guarantees.
Model limits
Section titled “Model limits”Keep inputs and option lists short. Laya’s English checkpoint has a 512-token context window including question headers, and long input may be truncated. Review the Laya project for model details.