Decides whether a turn is routine enough for the local model or needs the cloud.
The decision is a pure function of the input and the history, so it is deterministic and testable without a network. Local is chosen only when the input positively looks routine; any doubt goes to the cloud, where the quality is. The rules are applied in this order:
- an input that is not a string, or not valid UTF-8, is
:cloud, because it cannot be judged; - an input longer than 280 characters is
:cloud; - a history of more than 20 turns is
:cloud, because the context is heavy; - an input that asks for reasoning or writing is
:cloud; - an input that asks for triage or formatting is
:local; - anything else is
:cloud.
Summary
Functions
Returns the route the heuristic picks for input given the turns recorded so far.
Functions
@spec classify([Mead.Session.Turn.t()], term()) :: :local | :cloud
Returns the route the heuristic picks for input given the turns recorded so far.