Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.

Commit 7dee59c

Browse files
committed
DEV: Remove no longer needed seeded model check
1 parent fbbe01e commit 7dee59c

File tree

2 files changed

+0
-26
lines changed

2 files changed

+0
-26
lines changed

app/models/ai_persona.rb

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ class AiPersona < ActiveRecord::Base
1212
validates :system_prompt, presence: true, length: { maximum: 10_000_000 }
1313
validate :system_persona_unchangeable, on: :update, if: :system
1414
validate :chat_preconditions
15-
validate :allowed_seeded_model, if: :default_llm_id
1615
validate :well_formated_examples
1716
validates :max_context_posts, numericality: { greater_than: 0 }, allow_nil: true
1817
# leaves some room for growth but sets a maximum to avoid memory issues
@@ -365,17 +364,6 @@ def ensure_not_system
365364
end
366365
end
367366

368-
def allowed_seeded_model
369-
return if default_llm_id.blank?
370-
371-
return if default_llm.nil?
372-
return if !default_llm.seeded?
373-
374-
return if SiteSetting.ai_bot_allowed_seeded_models_map.include?(default_llm.id.to_s)
375-
376-
errors.add(:default_llm, I18n.t("discourse_ai.llm.configuration.invalid_seeded_model"))
377-
end
378-
379367
def well_formated_examples
380368
return if examples.blank?
381369

spec/models/ai_persona_spec.rb

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -211,20 +211,6 @@
211211
)
212212
end
213213

214-
it "validates allowed seeded model" do
215-
basic_persona.default_llm_id = seeded_llm_model.id
216-
217-
SiteSetting.ai_bot_allowed_seeded_models = ""
218-
219-
expect(basic_persona.valid?).to eq(false)
220-
expect(basic_persona.errors[:default_llm]).to include(
221-
I18n.t("discourse_ai.llm.configuration.invalid_seeded_model"),
222-
)
223-
224-
SiteSetting.ai_bot_allowed_seeded_models = "-1"
225-
expect(basic_persona.valid?).to eq(true)
226-
end
227-
228214
it "does not leak caches between sites" do
229215
AiPersona.create!(
230216
name: "pun_bot",

0 commit comments

Comments
 (0)