diff --git a/src/network.ts b/src/network.ts index 61985be..3e159cb 100644 --- a/src/network.ts +++ b/src/network.ts @@ -231,11 +231,10 @@ export class Network { routingAgent: RoutingAgent, input: string, ): Promise { - if (routingAgent.model === undefined && this.defaultModel) { - routingAgent = routingAgent.withModel(this.defaultModel); - } - - const result = await routingAgent.run(input, { network: this }); + const result = await routingAgent.run(input, { + network: this, + model: routingAgent.model || this.defaultModel, + }); const agentNames = routingAgent.lifecycles.onRoute({ result, agent: routingAgent,