work in progress adding roles to personas
# Conflicts: # app/models/ai_persona.rb
This commit is contained in:
parent
acd3ac2371
commit
6351c401f8
|
@ -125,6 +125,7 @@ module DiscourseAi
|
|||
:rag_chunk_overlap_tokens,
|
||||
:rag_conversation_chunks,
|
||||
:question_consolidator_llm,
|
||||
:role,
|
||||
allowed_group_ids: [],
|
||||
rag_uploads: [:id],
|
||||
)
|
||||
|
|
|
@ -23,7 +23,12 @@ class LocalizedAiPersonaSerializer < ApplicationSerializer
|
|||
:rag_chunk_tokens,
|
||||
:rag_chunk_overlap_tokens,
|
||||
:rag_conversation_chunks,
|
||||
:question_consolidator_llm
|
||||
:question_consolidator_llm,
|
||||
:role,
|
||||
:role_tags,
|
||||
:role_category_ids,
|
||||
:role_whispers,
|
||||
:role_max_responses_per_hour
|
||||
|
||||
has_one :user, serializer: BasicUserSerializer, embed: :object
|
||||
has_many :rag_uploads, serializer: UploadSerializer, embed: :object
|
||||
|
|
|
@ -26,6 +26,9 @@ const CREATE_ATTRIBUTES = [
|
|||
"rag_chunk_overlap_tokens",
|
||||
"rag_conversation_chunks",
|
||||
"question_consolidator_llm",
|
||||
"role",
|
||||
"role_category_ids",
|
||||
"role_whispers",
|
||||
];
|
||||
|
||||
const SYSTEM_ATTRIBUTES = [
|
||||
|
|
|
@ -23,6 +23,7 @@ import DTooltip from "float-kit/components/d-tooltip";
|
|||
import AiCommandSelector from "./ai-command-selector";
|
||||
import AiLlmSelector from "./ai-llm-selector";
|
||||
import AiPersonaCommandOptions from "./ai-persona-command-options";
|
||||
import RoleSelector from "./ai-persona-role-selector";
|
||||
import PersonaRagUploader from "./persona-rag-uploader";
|
||||
|
||||
export default class PersonaEditor extends Component {
|
||||
|
@ -336,6 +337,14 @@ export default class PersonaEditor extends Component {
|
|||
disabled={{this.editingModel.system}}
|
||||
/>
|
||||
</div>
|
||||
<div class="control-group ai-persona-editor__role">
|
||||
<label>{{I18n.t "discourse_ai.ai_persona.role"}}</label>
|
||||
<RoleSelector
|
||||
class="ai-persona-editor__role_selctor"
|
||||
@value={{this.editingModel.role}}
|
||||
@disabled={{this.editingModel.system}}
|
||||
/>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label>{{I18n.t "discourse_ai.ai_persona.default_llm"}}</label>
|
||||
<AiLlmSelector
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
import { computed, observer } from "@ember/object";
|
||||
import I18n from "discourse-i18n";
|
||||
import ComboBox from "select-kit/components/combo-box";
|
||||
|
||||
export default ComboBox.extend({
|
||||
_modelDisabledChanged: observer("attrs.disabled", function () {
|
||||
this.selectKit.options.set("disabled", this.get("attrs.disabled.value"));
|
||||
}),
|
||||
|
||||
content: computed(function () {
|
||||
return [
|
||||
{
|
||||
id: "bot",
|
||||
name: I18n.t("discourse_ai.ai_persona.role_options.bot"),
|
||||
},
|
||||
{
|
||||
id: "message_responder",
|
||||
name: I18n.t("discourse_ai.ai_persona.role_options.message_responder"),
|
||||
},
|
||||
];
|
||||
}),
|
||||
|
||||
selectKitOptions: {
|
||||
filterable: false,
|
||||
},
|
||||
});
|
|
@ -137,6 +137,10 @@ en:
|
|||
mentionable: Mentionable
|
||||
mentionable_help: If enabled, users in allowed groups can mention this user in posts and messages, the AI will respond as this persona.
|
||||
user: User
|
||||
role: Role
|
||||
role_options:
|
||||
bot: Bot
|
||||
message_responder: Message Responder
|
||||
create_user: Create User
|
||||
create_user_help: You can optionally attach a user to this persona. If you do, the AI will use this user to respond to requests.
|
||||
default_llm: Default Language Model
|
||||
|
|
Loading…
Reference in New Issue