An example
Message: Please cancel my subscription and refund my last payment.
- A classifier might return
billing. - Intent detection returns
{ "intent": "cancel_subscription", "confidence": 0.96, "entities": { "refund_requested": true } }, which your code can act on directly.
Routing on confidence
A common production pattern is to auto-route messages above a high confidence (for example 0.85), ask a clarifying question between 0.5 and 0.85, and send anything lower to a human or a general chat model. This keeps expensive generation calls for the messages that need them.