+
{{llm.display_name}}
{{this.modelDescription llm}}
@@ -149,18 +153,20 @@ export default class AiLlmsListEditor extends Component {
{{/if}}
|
-
+ |
+
+ {{i18n "discourse_ai.llms.provider"}}
+
{{i18n
(concat "discourse_ai.llms.providers." llm.provider)
}}
|
-
+ |
- {{icon "wrench"}}
{{i18n "discourse_ai.llms.edit"}}
@@ -173,7 +179,17 @@ export default class AiLlmsListEditor extends Component {
{{/if}}
-
+
{
- this._noPersonaText = result;
- });
- }
-
- return this._noPersonaText;
- }
@action
async toggleEnabled(persona) {
@@ -53,74 +39,76 @@ export default class AiPersonaListEditor extends Component {
{{#if @currentPersona}}
{{else}}
-
+ @icon="plus"
+ class="ai-persona-list-editor__new-button"
+ />
+
+
-
-
- {{i18n
- "discourse_ai.ai_persona.what_are_personas"
- }}
- {{this.noPersonaText}}
-
-
-
-
-
-
- {{i18n "discourse_ai.ai_persona.name"}} |
- {{i18n "discourse_ai.ai_persona.enabled"}} |
- |
-
-
-
- {{#each @personas as |persona|}}
-
-
-
-
-
- {{persona.name}}
-
-
-
- {{persona.description}}
-
-
- |
-
-
- |
-
- {{i18n "discourse_ai.ai_persona.edit"}}
- |
+ {{#if @personas}}
+
+
+
+ {{i18n "discourse_ai.ai_persona.name"}} |
+ {{i18n "discourse_ai.ai_persona.enabled"}} |
+ |
- {{/each}}
-
-
+
+
+ {{#each @personas as |persona|}}
+
+
+
+
+
+ {{persona.name}}
+
+
+
+ {{persona.description}}
+
+
+ |
+
+
+ |
+
+ {{i18n "discourse_ai.ai_persona.edit"}}
+ |
+
+ {{/each}}
+
+
+ {{else}}
+
+ {{/if}}
{{/if}}
diff --git a/assets/javascripts/discourse/components/ai-tool-list-editor.gjs b/assets/javascripts/discourse/components/ai-tool-list-editor.gjs
index 6344f4dd..2725dc02 100644
--- a/assets/javascripts/discourse/components/ai-tool-list-editor.gjs
+++ b/assets/javascripts/discourse/components/ai-tool-list-editor.gjs
@@ -2,9 +2,10 @@ import Component from "@glimmer/component";
import { LinkTo } from "@ember/routing";
import { service } from "@ember/service";
import DBreadcrumbsItem from "discourse/components/d-breadcrumbs-item";
-import icon from "discourse-common/helpers/d-icon";
import i18n from "discourse-common/helpers/i18n";
import I18n from "discourse-i18n";
+import AdminConfigAreaEmptyList from "admin/components/admin-config-area-empty-list";
+import AdminPageSubheader from "admin/components/admin-page-subheader";
export default class AiToolListEditor extends Component {
@service adminPluginNavManager;
@@ -15,44 +16,64 @@ export default class AiToolListEditor extends Component {
@label={{i18n "discourse_ai.tools.short_title"}}
/>
}
diff --git a/assets/stylesheets/modules/llms/common/ai-llms-editor.scss b/assets/stylesheets/modules/llms/common/ai-llms-editor.scss
index 90fd371d..9397c2d4 100644
--- a/assets/stylesheets/modules/llms/common/ai-llms-editor.scss
+++ b/assets/stylesheets/modules/llms/common/ai-llms-editor.scss
@@ -67,43 +67,6 @@
}
.ai-llms-list-editor__configured {
- p {
- margin: 0;
- color: var(--primary-high);
- @include breakpoint("mobile-extra-large") {
- display: none;
- }
- }
-
- table {
- th {
- white-space: nowrap;
- }
- tr:hover {
- background: transparent;
- }
- td {
- padding: 1em 0.5em;
- }
- }
-
- .column-name {
- width: 100%;
- }
-
- .column-edit {
- text-align: right;
-
- @include breakpoint("mobile-extra-large") {
- .d-button-label {
- display: none;
- }
- .d-icon {
- margin: 0;
- }
- }
- }
-
.d-toggle-switch {
justify-content: center;
}
@@ -129,7 +92,7 @@
}
}
- p {
+ .admin-section-landing-item__description {
color: var(--primary-high);
margin: 0.25em 0 0.5em;
line-height: var(--line-height-large);
diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml
index 82cde4fd..0c6ddab7 100644
--- a/config/locales/client.en.yml
+++ b/config/locales/client.en.yml
@@ -173,6 +173,7 @@ en:
allowed_groups: "Allowed groups"
confirm_delete: "Are you sure you want to delete this persona?"
new: "New persona"
+ no_personas: "You have not created any personas yet"
title: "Personas"
short_title: "Personas"
delete: "Delete"
@@ -185,17 +186,7 @@ en:
tool_options: "Tool options"
rag_conversation_chunks: "Search conversation chunks"
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."
- what_are_personas: "What are Personas?"
- no_persona_selected: |
- 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.
-
- #### Why use personas?
-
- With personas, you can tailor the AI's behavior to better fit the context and tone of your forum. Whether you want the AI to be more formal for a professional setting, more casual for a community forum, or even embody a specific character for a role-playing game, personas give you the flexibility to do so.
-
- #### Group-specific access to personas
-
- Moreover, you can set it up so that certain user groups have access to specific personas. This means you can have different AI behaviors for different sections of your forum, further enhancing the diversity and richness of your community's interactions.
+ 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."
rag:
options:
@@ -219,8 +210,10 @@ en:
tools:
back: "Back"
short_title: "Tools"
- new: "New tool"
+ no_tools: "You have not created any tools yet"
name: "Name"
+ subheader_description: "Tools extend the capabilities of AI bots with user-defined JavaScript functions."
+ new: "New tool"
name_help: "The unique name of the tool as used by the language model"
description: "Description"
description_help: "A clear description of the tool's purpose for the language model"
@@ -303,6 +296,7 @@ en:
preconfigured:
title_no_llms: "Select a template to get started"
title: "Unconfigured LLM templates"
+ description: "LLMs (Large Language Models) are AI tools optimized for tasks like summarizing content, generating reports, automating customer interactions, and facilitating forum moderation and insights."
fake: "Manual configuration"
button: "Set up"
next:
diff --git a/spec/system/admin_ai_persona_spec.rb b/spec/system/admin_ai_persona_spec.rb
index 4bee1f14..4864d54a 100644
--- a/spec/system/admin_ai_persona_spec.rb
+++ b/spec/system/admin_ai_persona_spec.rb
@@ -11,7 +11,7 @@ RSpec.describe "Admin AI persona configuration", type: :system, js: true do
it "allows creation of a persona" do
visit "/admin/plugins/discourse-ai/ai-personas"
- find(".ai-persona-list-editor__header .btn-primary").click()
+ find(".ai-persona-list-editor__new-button").click()
find(".ai-persona-editor__name").set("Test Persona")
find(".ai-persona-editor__description").fill_in(with: "I am a test persona")
find(".ai-persona-editor__system_prompt").fill_in(with: "You are a helpful bot")
diff --git a/spec/system/llms/ai_llm_spec.rb b/spec/system/llms/ai_llm_spec.rb
index 12a2ac62..852cc784 100644
--- a/spec/system/llms/ai_llm_spec.rb
+++ b/spec/system/llms/ai_llm_spec.rb
@@ -76,14 +76,14 @@ RSpec.describe "Managing LLM configurations", type: :system, js: true do
it "shows the provider as CDCK in the UI" do
visit "/admin/plugins/discourse-ai/ai-llms"
expect(page).to have_css(
- "[data-llm-id='cdck-hosted'] .column-provider",
+ "[data-llm-id='cdck-hosted']",
text: I18n.t("js.discourse_ai.llms.providers.CDCK"),
)
end
it "shows an info alert to the user about the seeded LLM" do
visit "/admin/plugins/discourse-ai/ai-llms"
- find("[data-llm-id='#{llm_model.name}'] .column-edit .btn").click()
+ find("[data-llm-id='#{llm_model.name}'] .ai-llm-list__edit-button").click()
expect(page).to have_css(
".alert.alert-info",
text: I18n.t("js.discourse_ai.llms.seeded_warning"),
@@ -92,7 +92,7 @@ RSpec.describe "Managing LLM configurations", type: :system, js: true do
it "limits and shows disabled inputs for the seeded LLM" do
visit "/admin/plugins/discourse-ai/ai-llms"
- find("[data-llm-id='cdck-hosted'] .column-edit .btn").click()
+ find("[data-llm-id='cdck-hosted'] .ai-llm-list__edit-button").click()
expect(page).to have_css(".ai-llm-editor__display-name[disabled]")
expect(page).to have_css(".ai-llm-editor__name[disabled]")
expect(page).to have_css(".ai-llm-editor__provider.is-disabled")
|