discourse-ai/lib/configuration/persona_enumerator.rb

18 lines
348 B
Ruby

# frozen_string_literal: true
require "enum_site_setting"
module DiscourseAi
module Configuration
class PersonaEnumerator < ::EnumSiteSetting
def self.valid_value?(val)
true
end
def self.values
AiPersona.all_personas.map { |persona| { name: persona.name, value: persona.id } }
end
end
end
end