mirror of
https://github.com/discourse/discourse-ai.git
synced 2025-02-13 23:14:42 +00:00
This is a rather huge refactor with 1 new feature (tool details can be suppressed) Previously we use the name "Command" to describe "Tools", this unifies all the internal language and simplifies the code. We also amended the persona UI to use less DToggles which aligns with our design guidelines. Co-authored-by: Martin Brennan <martin@discourse.org>
45 lines
1.0 KiB
Ruby
45 lines
1.0 KiB
Ruby
# frozen_string_literal: true
|
|
|
|
class LocalizedAiPersonaSerializer < ApplicationSerializer
|
|
root "ai_persona"
|
|
|
|
attributes :id,
|
|
:name,
|
|
:description,
|
|
:enabled,
|
|
:system,
|
|
:priority,
|
|
:tools,
|
|
:system_prompt,
|
|
:allowed_group_ids,
|
|
:temperature,
|
|
:top_p,
|
|
:mentionable,
|
|
:default_llm,
|
|
:user_id,
|
|
:max_context_posts,
|
|
:vision_enabled,
|
|
:vision_max_pixels,
|
|
:rag_chunk_tokens,
|
|
:rag_chunk_overlap_tokens,
|
|
:rag_conversation_chunks,
|
|
:question_consolidator_llm,
|
|
:allow_chat,
|
|
:tool_details
|
|
|
|
has_one :user, serializer: BasicUserSerializer, embed: :object
|
|
has_many :rag_uploads, serializer: UploadSerializer, embed: :object
|
|
|
|
def rag_uploads
|
|
object.uploads
|
|
end
|
|
|
|
def name
|
|
object.class_instance.name
|
|
end
|
|
|
|
def description
|
|
object.class_instance.description
|
|
end
|
|
end
|