This repository was archived by the owner on Jul 22, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +0
-26
lines changed Expand file tree Collapse file tree 2 files changed +0
-26
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change 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" ,
You can’t perform that action at this time.
0 commit comments