From e30f06a6b459ac8e058de2ca7294135e6ad18cad Mon Sep 17 00:00:00 2001 From: Roman Rizzi Date: Tue, 18 Jun 2024 14:16:19 -0300 Subject: [PATCH] Made 3.5-turbo-16k the default version so we can remove hack --- db/post_migrate/20240528144216_seed_open_ai_models.rb | 2 +- lib/ai_bot/bot.rb | 6 ------ spec/lib/modules/ai_bot/playground_spec.rb | 4 ++-- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/db/post_migrate/20240528144216_seed_open_ai_models.rb b/db/post_migrate/20240528144216_seed_open_ai_models.rb index c8fd35ba..0d6fde0a 100644 --- a/db/post_migrate/20240528144216_seed_open_ai_models.rb +++ b/db/post_migrate/20240528144216_seed_open_ai_models.rb @@ -6,7 +6,7 @@ def up open_ai_api_key = fetch_setting("ai_openai_api_key") enabled_models = fetch_setting("ai_bot_enabled_chat_bots")&.split("|").to_a - enabled_models = ["gpt-3.5-turbo"] if enabled_models.empty? + enabled_models = ["gpt-3.5-turbo-16k"] if enabled_models.empty? if open_ai_api_key.present? models << mirror_open_ai( diff --git a/lib/ai_bot/bot.rb b/lib/ai_bot/bot.rb index 1e970a70..36fbe098 100644 --- a/lib/ai_bot/bot.rb +++ b/lib/ai_bot/bot.rb @@ -167,12 +167,6 @@ def self.guess_model(bot_user) return if associated_llm.nil? # Might be a persona user. Handled by constructor. - # TODO(roman): Dynamically listing bot users in the settings will let us remove this replacements. - if associated_llm.name == "gpt-3.5-turbo" - gpt_16k_version = LlmModel.find_by(name: "gpt-3.5-turbo-16k") - associated_llm = gpt_16k_version if gpt_16k_version - end - "custom:#{associated_llm.id}" end diff --git a/spec/lib/modules/ai_bot/playground_spec.rb b/spec/lib/modules/ai_bot/playground_spec.rb index cfcc7a8d..79053e56 100644 --- a/spec/lib/modules/ai_bot/playground_spec.rb +++ b/spec/lib/modules/ai_bot/playground_spec.rb @@ -471,7 +471,7 @@ # title is queued first, ensures it uses the llm targeted via target_usernames not claude DiscourseAi::Completions::Llm.with_prepared_responses( ["Magic title", "Yes I can"], - llm: "open_ai:gpt-3.5-turbo-16k", + llm: "open_ai:gpt-3.5-turbo", ) do post = create_post( @@ -503,7 +503,7 @@ # replies as correct persona if replying direct to persona DiscourseAi::Completions::Llm.with_prepared_responses( ["Another reply"], - llm: "open_ai:gpt-3.5-turbo-16k", + llm: "open_ai:gpt-3.5-turbo", ) do create_post( raw: "Please ignore this bot, I am replying to a user",