Controlling the flow of execution between agents in a Network.
defaultRouter
option in createNetwork
defines how agents are coordinated within a Network. It can be either a Function Router or a Routing Agent.
defaultRouter
option in createNetwork
.
Network.State
for more details.InferenceResult
for more details.Return Type | Description |
---|---|
Agent | Single agent to execute next |
Agent[] | Multiple agents to execute in sequence |
RoutingAgent | Delegate routing decision to another routing agent |
undefined | Stop network execution |
defaultRouter
in a network.
defaultModel
.RoutingAgent
instance that can be used as a network’s defaultRouter
.