From 0a60c093e4dbbd6a467a3d17edeb8b236089901c Mon Sep 17 00:00:00 2001 From: Tony Holdstock-Brown Date: Tue, 10 Dec 2024 07:47:14 -0800 Subject: [PATCH] Don't set routing model, and always inject into run if unset --- src/network.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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,