discourse-ai/db/migrate/20231109011155_create_ai_personas.rb
Sam a4f419f54f
FEATURE: basic infrastructure for custom personas (#288)
- New AiPersona model which can store custom personas
- Persona are restricted via group security
- They can contain custom system messages
- They can support a list of commands optionally

To avoid expensive DB calls in the serializer a Multisite friendly Hash was introduced (which can be expired on transaction commit)
2023-11-10 11:39:49 +11:00

19 lines
620 B
Ruby

# frozen_string_literal: true
#
class CreateAiPersonas < ActiveRecord::Migration[7.0]
def change
create_table :ai_personas do |t|
t.string :name, null: false, unique: true, limit: 100
t.string :description, null: false, limit: 2000
t.string :commands, array: true, default: [], null: false
t.string :system_prompt, null: false, limit: 10_000_000
t.integer :allowed_group_ids, array: true, default: [], null: false
t.integer :created_by_id
t.boolean :enabled, default: true, null: false
t.timestamps
end
add_index :ai_personas, :name, unique: true
end
end