Skip to content

Commit

Permalink
Made 3.5-turbo-16k the default version so we can remove hack
Browse files Browse the repository at this point in the history
  • Loading branch information
romanrizzi committed Jun 18, 2024
1 parent 31a8263 commit e30f06a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
2 changes: 1 addition & 1 deletion db/post_migrate/20240528144216_seed_open_ai_models.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
6 changes: 0 additions & 6 deletions lib/ai_bot/bot.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions spec/lib/modules/ai_bot/playground_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit e30f06a

Please sign in to comment.