Customize how calls are routed between Agents in a Network.
Agent
)undefined
)defaultRouter
function returning either an instance of an Agent
object or undefined
.
defaultRouter
function receives a number of arguments:
undefined
stops the network’s execution loopdefaultRouter
defined, the network will use the “Default Routing Agent” to decide which agent to call next.
The “Default Routing Agent” is a Routing Agent provided by Agent Kit to handle the default routing logic.
You can create your own Routing Agent by using the createRoutingAgent
helper function:
onRoute
lifecycle method.