From f0e8eb49be13b40f4ac0a416d5a00a9e6febc957 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peer=20Sch=C3=BCtt?= <20603780+peerschuett@users.noreply.github.com> Date: Mon, 19 May 2025 17:50:23 +0200 Subject: [PATCH] Added initial description texts --- .../Components/ChatComponent.razor | 3 ++- .../Components/ChatComponent.razor.cs | 3 +++ .../Components/ChatTemplateSelection.razor | 2 +- .../Settings/SettingsPanelChatTemplates.razor | 12 +++++---- .../Dialogs/ChatTemplateDialog.razor | 27 ++++++++++--------- .../Dialogs/ChatTemplateDialog.razor.cs | 4 +-- 6 files changed, 29 insertions(+), 22 deletions(-) diff --git a/app/MindWork AI Studio/Components/ChatComponent.razor b/app/MindWork AI Studio/Components/ChatComponent.razor index fb1b2768..4f17ad83 100644 --- a/app/MindWork AI Studio/Components/ChatComponent.razor +++ b/app/MindWork AI Studio/Components/ChatComponent.razor @@ -106,8 +106,9 @@ } - + + @if (PreviewFeatures.PRE_RAG_2024.IsEnabled(this.SettingsManager)) diff --git a/app/MindWork AI Studio/Components/ChatComponent.razor.cs b/app/MindWork AI Studio/Components/ChatComponent.razor.cs index 31c37c28..4a0007a3 100644 --- a/app/MindWork AI Studio/Components/ChatComponent.razor.cs +++ b/app/MindWork AI Studio/Components/ChatComponent.razor.cs @@ -60,6 +60,7 @@ public partial class ChatComponent : MSGComponentBase, IAsyncDisposable private string currentWorkspaceName = string.Empty; private Guid currentWorkspaceId = Guid.Empty; private CancellationTokenSource? cancellationTokenSource; + private bool disableProfile = false; // TODO // Unfortunately, we need the input field reference to blur the focus away. Without // this, we cannot clear the input field. @@ -328,6 +329,7 @@ public partial class ChatComponent : MSGComponentBase, IAsyncDisposable private async Task ChatTemplateWasChanged(ChatTemplate chatTemplate) { this.currentChatTemplate = chatTemplate; + this.disableProfile = !chatTemplate.AllowProfileUsage; if(this.ChatThread is null) return; @@ -813,6 +815,7 @@ public partial class ChatComponent : MSGComponentBase, IAsyncDisposable this.currentChatTemplate = this.SettingsManager.ConfigurationData.ChatTemplates.FirstOrDefault(x => x.Id == chatChatTemplate); if(this.currentChatTemplate == default) this.currentChatTemplate = ChatTemplate.NO_CHATTEMPLATE; + this.disableProfile = !this.currentChatTemplate.AllowProfileUsage; } } diff --git a/app/MindWork AI Studio/Components/ChatTemplateSelection.razor b/app/MindWork AI Studio/Components/ChatTemplateSelection.razor index f20b2fbb..901f6f08 100644 --- a/app/MindWork AI Studio/Components/ChatTemplateSelection.razor +++ b/app/MindWork AI Studio/Components/ChatTemplateSelection.razor @@ -1,6 +1,6 @@ @inherits MSGComponentBase - + @foreach (var chatTemplate in this.SettingsManager.ConfigurationData.ChatTemplates.GetAllChatTemplates()) { diff --git a/app/MindWork AI Studio/Components/Settings/SettingsPanelChatTemplates.razor b/app/MindWork AI Studio/Components/Settings/SettingsPanelChatTemplates.razor index e77788bf..1be0158b 100644 --- a/app/MindWork AI Studio/Components/Settings/SettingsPanelChatTemplates.razor +++ b/app/MindWork AI Studio/Components/Settings/SettingsPanelChatTemplates.razor @@ -1,16 +1,18 @@ @inherits SettingsPanelBase - + @T("Your Chat Templates") + - @T("Explain chat Templates TODO") + @T("Customize your AI experience with our Chat Templates! Whether you want to experiment with prompt engineering, simply use a custom system prompt in the standard chat interface, or create a specialized assistant, our templates give you full control. Similar to OpenAI's playground, you can define your own system prompts and leverage assistant prompts for providers that support them.") + + + + @T("Note: This advanced feature is designed for users familiar with prompt engineering concepts.") - - @T("Explain chat Templates TODO") - diff --git a/app/MindWork AI Studio/Dialogs/ChatTemplateDialog.razor b/app/MindWork AI Studio/Dialogs/ChatTemplateDialog.razor index 21d83bc1..0954edef 100644 --- a/app/MindWork AI Studio/Dialogs/ChatTemplateDialog.razor +++ b/app/MindWork AI Studio/Dialogs/ChatTemplateDialog.razor @@ -5,17 +5,15 @@ - - @T("Store chat templates.") - - @T("Are you always using the same prompts and want a way of automatically using them?") + @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("The name of the chat template is mandatory. Each chat template must have a unique name.") + @* ReSharper disable once CSharpWarnings::CS8974 *@ - + - What should you know about the additional messages? TODO + + @T("Example Exchanges") + - - - Additional messages - + + @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.") + + + @@ -70,7 +71,7 @@ Actions - @context.Role + @context.Role.ToChatTemplateName() @(context.Content is ContentText textContent ? textContent.Text : context.Content?.ToString()) @@ -101,12 +102,12 @@ - + - @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 e5c6ca96..c098632c 100644 --- a/app/MindWork AI Studio/Dialogs/ChatTemplateDialog.razor.cs +++ b/app/MindWork AI Studio/Dialogs/ChatTemplateDialog.razor.cs @@ -200,8 +200,8 @@ public partial class ChatTemplateDialog : MSGComponentBase private string? ValidateSystemPrompt(string text) { - if (string.IsNullOrWhiteSpace(this.DataSystemPrompt))// && string.IsNullOrWhiteSpace(this.DataActions)) - return T("Please enter the system prompt."); + // if (string.IsNullOrWhiteSpace(this.DataSystemPrompt))// && string.IsNullOrWhiteSpace(this.DataActions)) + // return T("Please enter the system prompt."); if(text.Length > 444) return T("The text must not exceed 444 characters.");