@@ -20,6 +20,7 @@ class AiPersona < ActiveRecord::Base
2020 validates :rag_chunk_tokens , numericality : { greater_than : 0 , maximum : 50_000 }
2121 validates :rag_chunk_overlap_tokens , numericality : { greater_than : -1 , maximum : 200 }
2222 validates :rag_conversation_chunks , numericality : { greater_than : 0 , maximum : 1000 }
23+ validates :forced_tool_count , numericality : { greater_than : -2 , maximum : 100_000 }
2324 has_many :rag_document_fragments , dependent : :destroy , as : :target
2425
2526 belongs_to :created_by , class_name : "User"
@@ -185,6 +186,7 @@ def class_instance
185186
186187 define_method ( :tools ) { tools }
187188 define_method ( :force_tool_use ) { force_tool_use }
189+ define_method ( :forced_tool_count ) { @ai_persona &.forced_tool_count }
188190 define_method ( :options ) { options }
189191 define_method ( :temperature ) { @ai_persona &.temperature }
190192 define_method ( :top_p ) { @ai_persona &.top_p }
@@ -265,32 +267,40 @@ def ensure_not_system
265267#
266268# Table name: ai_personas
267269#
268- # id :bigint not null, primary key
269- # name :string(100) not null
270- # description :string(2000) not null
271- # system_prompt :string(10000000) not null
272- # allowed_group_ids :integer default([]), not null, is an Array
273- # created_by_id :integer
274- # enabled :boolean default(TRUE), not null
275- # created_at :datetime not null
276- # updated_at :datetime not null
277- # system :boolean default(FALSE), not null
278- # priority :boolean default(FALSE), not null
279- # temperature :float
280- # top_p :float
281- # user_id :integer
282- # mentionable :boolean default(FALSE), not null
283- # default_llm :text
284- # max_context_posts :integer
285- # vision_enabled :boolean default(FALSE), not null
286- # vision_max_pixels :integer default(1048576), not null
287- # rag_chunk_tokens :integer default(374), not null
288- # rag_chunk_overlap_tokens :integer default(10), not null
289- # rag_conversation_chunks :integer default(10), not null
290- # question_consolidator_llm :text
291- # allow_chat :boolean default(FALSE), not null
292- # tool_details :boolean default(TRUE), not null
293- # tools :json not null
270+ # id :bigint not null, primary key
271+ # name :string(100) not null
272+ # description :string(2000) not null
273+ # system_prompt :string(10000000) not null
274+ # allowed_group_ids :integer default([]), not null, is an Array
275+ # created_by_id :integer
276+ # enabled :boolean default(TRUE), not null
277+ # created_at :datetime not null
278+ # updated_at :datetime not null
279+ # system :boolean default(FALSE), not null
280+ # priority :boolean default(FALSE), not null
281+ # temperature :float
282+ # top_p :float
283+ # user_id :integer
284+ # mentionable :boolean default(FALSE), not null
285+ # default_llm :text
286+ # max_context_posts :integer
287+ # max_post_context_tokens :integer
288+ # max_context_tokens :integer
289+ # vision_enabled :boolean default(FALSE), not null
290+ # vision_max_pixels :integer default(1048576), not null
291+ # rag_chunk_tokens :integer default(374), not null
292+ # rag_chunk_overlap_tokens :integer default(10), not null
293+ # rag_conversation_chunks :integer default(10), not null
294+ # role :enum default("bot"), not null
295+ # role_category_ids :integer default([]), not null, is an Array
296+ # role_tags :string default([]), not null, is an Array
297+ # role_group_ids :integer default([]), not null, is an Array
298+ # role_whispers :boolean default(FALSE), not null
299+ # role_max_responses_per_hour :integer default(50), not null
300+ # question_consolidator_llm :text
301+ # allow_chat :boolean default(FALSE), not null
302+ # tool_details :boolean default(TRUE), not null
303+ # tools :json not null
294304#
295305# Indexes
296306#
0 commit comments