mirror of
https://github.com/discourse/discourse-ai.git
synced 2025-06-30 19:42:17 +00:00
Additional changes: Adds a "#features" method in AiPersona to find which features are using that persona. Serializes a basic version of a LlmModel in the persona's "#default_llm" serializer attribute.
13 lines
289 B
Ruby
13 lines
289 B
Ruby
# frozen_string_literal: true
|
|
|
|
class AiFeaturesPersonaSerializer < ApplicationSerializer
|
|
attributes :id, :name, :allowed_groups
|
|
|
|
def allowed_groups
|
|
Group
|
|
.where(id: object.allowed_group_ids)
|
|
.pluck(:id, :name)
|
|
.map { |id, name| { id: id, name: name } }
|
|
end
|
|
end
|