From the course: Claude Code: Designing Multi-Model AI Systems

Unlock this course with a free trial

Join today to access over 25,500 courses taught by industry experts.

Confidence-based fallbacks for edge cases

Confidence-based fallbacks for edge cases

Our routing works when the classifier is confident. But what about ambiguous messages? Something like, can I get a refund on my upgrade? Is that a product question? A billing issue? The classifier might not be sure. We need a safety net. If the classifier's confidence is low, we fall back to SONET. Let the smart model figure it out. Better spend a little extra than give a wrong CAN response. So, let's find the 25 and fallback's prompt file. We will create rules such as if the classifier confidence is equal or larger than 0.7, we will have a route-based intent. This is the existing routing logic we had. However, if the classifier confidence is smaller than 0.7, we ignore the intent and send to SONET regardless. This is the safe fallback. We let the smart model handle ambiguity. We also have the debug mode here. It will show the route as one of canned, classified SONET or fallback SONET. So we will know which way we went. And we have all the existing colors and debug formatting. Let's…

Contents