UX: Show AI bot toggles in the AI bot options section (#1229)

This commit is contained in:
Roman Rizzi 2025-03-27 16:46:35 -03:00 committed by GitHub
parent da2b083025
commit f43137e067
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 24 additions and 21 deletions

View File

@ -283,25 +283,6 @@ export default class PersonaEditor extends Component {
/>
<div class="ai-persona-editor" {{didInsert this.updateAllGroups @model.id}}>
<Form @onSubmit={{this.save}} @data={{this.formData}} as |form data|>
<form.Field
@name="enabled"
@title={{i18n "discourse_ai.ai_persona.enabled"}}
@onSet={{fn this.toggleEnabled data}}
as |field|
>
<field.Toggle />
</form.Field>
<form.Field
@name="priority"
@title={{i18n "discourse_ai.ai_persona.priority"}}
@onSet={{fn this.togglePriority data}}
@tooltip={{i18n "discourse_ai.ai_persona.priority_help"}}
as |field|
>
<field.Toggle />
</form.Field>
<form.Field
@name="name"
@title={{i18n "discourse_ai.ai_persona.name"}}
@ -562,6 +543,25 @@ export default class PersonaEditor extends Component {
{{/if}}
<form.Section @title={{i18n "discourse_ai.ai_persona.ai_bot.title"}}>
<form.Field
@name="enabled"
@title={{i18n "discourse_ai.ai_persona.enabled"}}
@onSet={{fn this.toggleEnabled data}}
as |field|
>
<field.Toggle />
</form.Field>
<form.Field
@name="priority"
@title={{i18n "discourse_ai.ai_persona.priority"}}
@onSet={{fn this.togglePriority data}}
@tooltip={{i18n "discourse_ai.ai_persona.priority_help"}}
as |field|
>
<field.Toggle />
</form.Field>
{{#if @model.isNew}}
<div>{{i18n "discourse_ai.ai_persona.ai_bot.save_first"}}</div>
{{else}}

View File

@ -61,7 +61,7 @@ export default class AiPersonaListEditor extends Component {
<thead>
<tr>
<th>{{i18n "discourse_ai.ai_persona.name"}}</th>
<th>{{i18n "discourse_ai.ai_persona.enabled"}}</th>
<th>{{i18n "discourse_ai.ai_persona.list.enabled"}}</th>
<th></th>
</tr>
</thead>

View File

@ -307,9 +307,12 @@ en:
rag_conversation_chunks_help: "The number of chunks to use for the RAG model searches. Increase to increase the amount of context the AI can use."
persona_description: "Personas are a powerful feature that allows you to customize the behavior of the AI engine in your Discourse forum. They act as a 'system message' that guides the AI's responses and interactions, helping to create a more personalized and engaging user experience."
list:
enabled: "AI Bot?"
ai_bot:
title: "AI bot options"
save_first: "AI bot options will become available once you save the persona."
save_first: "More AI bot options will become available once you save the persona."
rag:
title: "RAG"