Classification is one of the simplest structured output tasks, but the details matter. An unconstrained classifier might returnDocumentation Index
Fetch the complete documentation index at: https://docs.dottxt.ai/llms.txt
Use this file to discover all available pages before exploring further.
"Billing", "billing", "billing issue", or "BILLING", all meaning the same thing but breaking your routing rules, analytics aggregations, and dashboard filters. An enum constraint eliminates this by restricting the output to exactly the values your system recognizes.
Adding an evidence field turns a bare label into an actionable decision. Evidence gives reviewers the specific input observations that drove the classification, so they can verify quickly instead of re-reading the full ticket.
Goal
Classify support tickets into a routing queue with a label, priority, and grounded evidence.Schema contract
Example input
Example output
Implementation tips
- Enum labels are non-negotiable. Every label value should map directly to a routing queue, a dashboard filter, or a database category. If the label isn’t in the enum, it can’t reach your system.
- Evidence grounds the decision. The bounded evidence array (1-3 items, 10-160 characters each) forces the model to cite specific observations from the input. This makes quality audits fast: reviewers check evidence against the ticket text instead of guessing why the model chose a label.
- Fallback for taxonomy drift. The second
oneOfbranch requiresother_labelwhenlabelis"other". This captures novel categories without polluting your main enum. Reviewother_labelvalues periodically and promote frequent ones into the enum. See Enum with Fallback.
Related docs
- Enum with fallback: handle novel categories without polluting your main enum
- Unions of objects: discriminated unions for routing to different output shapes
- Bounded arrays: control the size of evidence and tag arrays
- String reference | Conditionals reference