From 365f7f36e9ad4942c6b9bc9940dd52fdf694e155 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peer=20Sch=C3=BCtt?= <20603780+peerschuett@users.noreply.github.com> Date: Wed, 21 May 2025 16:58:24 +0200 Subject: [PATCH] Added a "use default system prompt" button and adapted the texts a bit --- .../Components/ChatComponent.razor | 7 +++- .../Settings/SettingsPanelChatTemplates.razor | 8 ++-- .../Dialogs/ChatTemplateDialog.razor | 41 +++++++++---------- .../Dialogs/ChatTemplateDialog.razor.cs | 5 +++ 4 files changed, 34 insertions(+), 27 deletions(-) diff --git a/app/MindWork AI Studio/Components/ChatComponent.razor b/app/MindWork AI Studio/Components/ChatComponent.razor index 4f17ad83..4886c8f1 100644 --- a/app/MindWork AI Studio/Components/ChatComponent.razor +++ b/app/MindWork AI Studio/Components/ChatComponent.razor @@ -109,8 +109,11 @@ - - + @if (this.SettingsManager.ConfigurationData.ChatTemplates.Count > 0) + { + + } + @if (PreviewFeatures.PRE_RAG_2024.IsEnabled(this.SettingsManager)) { diff --git a/app/MindWork AI Studio/Components/Settings/SettingsPanelChatTemplates.razor b/app/MindWork AI Studio/Components/Settings/SettingsPanelChatTemplates.razor index 1be0158b..2851f659 100644 --- a/app/MindWork AI Studio/Components/Settings/SettingsPanelChatTemplates.razor +++ b/app/MindWork AI Studio/Components/Settings/SettingsPanelChatTemplates.razor @@ -10,14 +10,14 @@ - @T("Note: This advanced feature is designed for users familiar with prompt engineering concepts.") + @T("Note: This advanced feature is designed for users familiar with prompt engineering concepts. Furthermore, you have to make sure yourself that your chosen provider supports the use of assistant prompts.") - + # @@ -30,10 +30,10 @@ - + - + diff --git a/app/MindWork AI Studio/Dialogs/ChatTemplateDialog.razor b/app/MindWork AI Studio/Dialogs/ChatTemplateDialog.razor index 0954edef..c49ab2e5 100644 --- a/app/MindWork AI Studio/Dialogs/ChatTemplateDialog.razor +++ b/app/MindWork AI Studio/Dialogs/ChatTemplateDialog.razor @@ -7,7 +7,7 @@ - @T("Create your custom chat template to tailor the LLM's behavior for specific tasks or domains. Define a custom system prompt and provide example exchanges to design an AI experience perfectly suited to your requirements.") + @T("Create your custom chat template to tailor the LLM's behavior for specific tasks or domains. Define a custom system prompt and provide an example conversation to design an AI experience perfectly suited to your requirements.") @@ -45,25 +45,32 @@ AutoGrow="@true" MaxLines="12" Class="mb-3" + MaxLength="444" UserAttributes="@SPELLCHECK_ATTRIBUTES" HelperText="@T("Tell the AI your system prompt.")" /> - + + @T("Use the default system prompt") + + + + + - @T("Example Exchanges") + @T("Example Conversation") - @T("Add example exchanges (user prompt followed by assistant response) to demonstrate the desired interaction pattern. These examples help the AI understand your expectations by showing it the correct format, style, and content of responses before it receives actual user inputs.") + @T("Add messages of an example conversation (user prompt followed by assistant prompt) to demonstrate the desired interaction pattern. These examples help the AI understand your expectations by showing it the correct format, style, and content of responses before it receives actual user inputs.") - + - - - + + + Role @@ -76,16 +83,8 @@ @(context.Content is ContentText textContent ? textContent.Text : context.Content?.ToString()) - - + + @@ -98,16 +97,16 @@ - + - + - @T("Add additional message") + @T("Add additional message") diff --git a/app/MindWork AI Studio/Dialogs/ChatTemplateDialog.razor.cs b/app/MindWork AI Studio/Dialogs/ChatTemplateDialog.razor.cs index c098632c..56069cd5 100644 --- a/app/MindWork AI Studio/Dialogs/ChatTemplateDialog.razor.cs +++ b/app/MindWork AI Studio/Dialogs/ChatTemplateDialog.razor.cs @@ -225,5 +225,10 @@ public partial class ChatTemplateDialog : MSGComponentBase return null; } + private void UseDefaultSystemPrompt() + { + this.DataSystemPrompt = SystemPrompts.DEFAULT; + } + private void Cancel() => this.MudDialog.Cancel(); } \ No newline at end of file