Skip to content

Commit

Permalink
Don't set routing model, and always inject into run if unset
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyhb committed Dec 10, 2024
1 parent ee5d9d8 commit 0a60c09
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,11 +231,10 @@ export class Network {
routingAgent: RoutingAgent,
input: string,
): Promise<Agent[] | undefined> {
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,
Expand Down

0 comments on commit 0a60c09

Please sign in to comment.