discourse-ai/app/serializers/ai_features_persona_serializer.rb
Keegan George 4de39a07e5
FEATURE: Configure persona backed features in admin panel (#1245)
In this feature update, we add the UI for the ability to easily configure persona backed AI-features. The feature will still be hidden until structured responses are complete.
2025-04-10 08:16:31 -07:00

13 lines
315 B
Ruby

# frozen_string_literal: true
class AiFeaturesPersonaSerializer < ApplicationSerializer
attributes :id, :name, :system_prompt, :allowed_groups, :enabled
def allowed_groups
Group
.where(id: object.allowed_group_ids)
.pluck(:id, :name)
.map { |id, name| { id: id, name: name } }
end
end