From 40a233a66b8988f3cdd6b049693c361e7edd4b0e Mon Sep 17 00:00:00 2001 From: Tim <135014430+nagisa77@users.noreply.github.com> Date: Fri, 31 Oct 2025 10:46:22 +0800 Subject: [PATCH] Allow bots to override agent model --- bots/bot_father.ts | 10 +++++++--- bots/instance/daily_news_bot.ts | 4 ++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/bots/bot_father.ts b/bots/bot_father.ts index 3cf6419cf..90e47d4fa 100644 --- a/bots/bot_father.ts +++ b/bots/bot_father.ts @@ -29,11 +29,11 @@ export abstract class BotFather { name: this.name, instructions: this.buildInstructions(), tools: [ - this.openisleMcp, - this.weatherMcp, + this.openisleMcp, + this.weatherMcp, this.webSearchPreview ], - model: "gpt-4o-mini", + model: this.getModel(), modelSettings: { temperature: 0.7, topP: 1, @@ -120,6 +120,10 @@ export abstract class BotFather { return []; } + protected getModel(): string { + return "gpt-4o-mini"; + } + protected createRunner(): Runner { return new Runner({ workflowName: this.name, diff --git a/bots/instance/daily_news_bot.ts b/bots/instance/daily_news_bot.ts index d8487f9fb..3708366a8 100644 --- a/bots/instance/daily_news_bot.ts +++ b/bots/instance/daily_news_bot.ts @@ -7,6 +7,10 @@ class DailyNewsBot extends BotFather { super("Daily News Bot"); } + protected override getModel(): string { + return "gpt-4o"; + } + protected override getAdditionalInstructions(): string[] { return [ "You are DailyNewsBot,专职在 OpenIsle 发布每日新闻速递。",