mirror of
https://github.com/discourse/discourse-ai.git
synced 2025-02-06 11:38:13 +00:00
a4f419f54f
- 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)
19 lines
620 B
Ruby
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
|