Skip to main content

resolve_route

Function
This function is defined in the protocols module.
Resolve the handling agent from priority-ordered bindings. Bindings are evaluated most-specific-first: the matching binding with the highest priority wins; ties are broken by specificity (exact peer → role/channel → account → chat-type), then by declaration order.

Signature

Parameters

List[RouteBinding]
required
Candidate route bindings (any order).
RouteFacts
required
Inbound facts extracted from the message.
str
default:"'default'"
Agent id to fall back to when nothing matches.

Returns

RouteMatch
class:RouteMatch with the selected agent and matched binding.

Uses

  • binding.matches
  • RouteMatch

Source

View on GitHub

praisonaiagents/gateway/protocols.py at line 1890