From 9e207974e9049a0507284a8dfdedda410101b185 Mon Sep 17 00:00:00 2001 From: Thorsten Sommer Date: Sat, 24 May 2025 19:11:28 +0200 Subject: [PATCH] Finalized chat templates (#475) --- .../Assistants/AssistantBase.razor.cs | 2 +- .../Assistants/I18N/allTexts.lua | 171 +++++++++++++++++ app/MindWork AI Studio/Chat/ChatRole.cs | 66 ------- .../Chat/ChatRoleExtensions.cs | 75 ++++++++ app/MindWork AI Studio/Chat/ChatThread.cs | 11 +- app/MindWork AI Studio/Chat/ContentBlock.cs | 19 +- app/MindWork AI Studio/Chat/ContentImage.cs | 19 +- app/MindWork AI Studio/Chat/ContentText.cs | 13 +- .../Components/ChatComponent.razor.cs | 13 +- .../Components/ChatTemplateSelection.razor | 15 +- .../Components/ChatTemplateSelection.razor.cs | 2 +- .../Components/ProfileSelection.razor.cs | 2 +- .../Settings/SettingsPanelChatTemplates.razor | 2 +- .../SettingsPanelChatTemplates.razor.cs | 4 +- .../Dialogs/ChatTemplateDialog.razor | 129 +++++++++---- .../Dialogs/ChatTemplateDialog.razor.cs | 177 ++++++++++-------- .../Dialogs/Settings/SettingsDialogChat.razor | 1 + .../plugin.lua | 171 +++++++++++++++++ .../plugin.lua | 171 +++++++++++++++++ .../Settings/ChatTemplate.cs | 3 +- .../Settings/SettingsManager.cs | 2 +- .../Tools/ChatTemplateExtensions.cs | 2 +- .../wwwroot/changelog/v0.9.45.md | 1 + 23 files changed, 830 insertions(+), 241 deletions(-) create mode 100644 app/MindWork AI Studio/Chat/ChatRoleExtensions.cs diff --git a/app/MindWork AI Studio/Assistants/AssistantBase.razor.cs b/app/MindWork AI Studio/Assistants/AssistantBase.razor.cs index a1e76f8c..c355fba1 100644 --- a/app/MindWork AI Studio/Assistants/AssistantBase.razor.cs +++ b/app/MindWork AI Studio/Assistants/AssistantBase.razor.cs @@ -89,7 +89,7 @@ public abstract partial class AssistantBase : AssistantLowerBase wher protected MudForm? form; protected bool inputIsValid; protected Profile currentProfile = Profile.NO_PROFILE; - protected ChatTemplate currentChatTemplate = ChatTemplate.NO_CHATTEMPLATE; + protected ChatTemplate currentChatTemplate = ChatTemplate.NO_CHAT_TEMPLATE; protected ChatThread? chatThread; protected IContent? lastUserPrompt; protected CancellationTokenSource? cancellationTokenSource; diff --git a/app/MindWork AI Studio/Assistants/I18N/allTexts.lua b/app/MindWork AI Studio/Assistants/I18N/allTexts.lua index 19c34326..3a9b6855 100644 --- a/app/MindWork AI Studio/Assistants/I18N/allTexts.lua +++ b/app/MindWork AI Studio/Assistants/I18N/allTexts.lua @@ -652,6 +652,24 @@ UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::TRANSLATION::ASSISTANTTRANSLATION::T61388 -- Please provide a custom language. UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::TRANSLATION::ASSISTANTTRANSLATION::T656744944"] = "Please provide a custom language." +-- System +UI_TEXT_CONTENT["AISTUDIO::CHAT::CHATROLEEXTENSIONS::T2402387132"] = "System" + +-- You +UI_TEXT_CONTENT["AISTUDIO::CHAT::CHATROLEEXTENSIONS::T3049115964"] = "You" + +-- Unknown +UI_TEXT_CONTENT["AISTUDIO::CHAT::CHATROLEEXTENSIONS::T3424652889"] = "Unknown" + +-- Assistant +UI_TEXT_CONTENT["AISTUDIO::CHAT::CHATROLEEXTENSIONS::T3662687431"] = "Assistant" + +-- User +UI_TEXT_CONTENT["AISTUDIO::CHAT::CHATROLEEXTENSIONS::T3768991250"] = "User" + +-- AI +UI_TEXT_CONTENT["AISTUDIO::CHAT::CHATROLEEXTENSIONS::T601166687"] = "AI" + -- Edit Message UI_TEXT_CONTENT["AISTUDIO::CHAT::CONTENTBLOCKCOMPONENT::T1183581066"] = "Edit Message" @@ -724,6 +742,9 @@ UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::CHATCOMPONENT::T1849313532"] = "Type your -- Your Prompt (use selected instance '{0}', provider '{1}') UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::CHATCOMPONENT::T1967611328"] = "Your Prompt (use selected instance '{0}', provider '{1}')" +-- Profile usage is disabled according to your chat template settings. +UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::CHATCOMPONENT::T2670286472"] = "Profile usage is disabled according to your chat template settings." + -- Delete this chat & start a new one. UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::CHATCOMPONENT::T2991985411"] = "Delete this chat & start a new one." @@ -751,6 +772,9 @@ UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::CHATCOMPONENT::T636393754"] = "Move the c -- Show your workspaces UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::CHATCOMPONENT::T733672375"] = "Show your workspaces" +-- Start a new chat with a chat template +UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::CHATTEMPLATESELECTION::T1333844707"] = "Start a new chat with a chat template" + -- Region UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::CONFIDENCEINFO::T1227782301"] = "Region" @@ -1063,6 +1087,45 @@ UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::SETTINGS::SETTINGSPANELAPP::T817101267"] -- Would you like to set one provider as the default for the entire app? When you configure a different provider for an assistant, it will always take precedence. UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::SETTINGS::SETTINGSPANELAPP::T844514734"] = "Would you like to set one provider as the default for the entire app? When you configure a different provider for an assistant, it will always take precedence." +-- Customize your AI experience with 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 common AI companies' playgrounds, you can define your own system prompts and leverage assistant prompts for providers that support them. +UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::SETTINGS::SETTINGSPANELCHATTEMPLATES::T1172171653"] = "Customize your AI experience with 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 common AI companies' playgrounds, you can define your own system prompts and leverage assistant prompts for providers that support them." + +-- Delete +UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::SETTINGS::SETTINGSPANELCHATTEMPLATES::T1469573738"] = "Delete" + +-- Add Chat Template +UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::SETTINGS::SETTINGSPANELCHATTEMPLATES::T1548314416"] = "Add Chat Template" + +-- 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. +UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::SETTINGS::SETTINGSPANELCHATTEMPLATES::T1909110760"] = "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." + +-- No chat templates configured yet. +UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::SETTINGS::SETTINGSPANELCHATTEMPLATES::T2319860307"] = "No chat templates configured yet." + +-- Configure Chat Templates +UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::SETTINGS::SETTINGSPANELCHATTEMPLATES::T2453567568"] = "Configure Chat Templates" + +-- Chat Template Name +UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::SETTINGS::SETTINGSPANELCHATTEMPLATES::T275026390"] = "Chat Template Name" + +-- Are you sure you want to delete the chat template '{0}'? +UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::SETTINGS::SETTINGSPANELCHATTEMPLATES::T3102555824"] = "Are you sure you want to delete the chat template '{0}'?" + +-- Edit +UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::SETTINGS::SETTINGSPANELCHATTEMPLATES::T3267849393"] = "Edit" + +-- Edit Chat Template +UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::SETTINGS::SETTINGSPANELCHATTEMPLATES::T3596030597"] = "Edit Chat Template" + +-- Your Chat Templates +UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::SETTINGS::SETTINGSPANELCHATTEMPLATES::T3824122683"] = "Your Chat Templates" + +-- Actions +UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::SETTINGS::SETTINGSPANELCHATTEMPLATES::T3865031940"] = "Actions" + +-- Delete Chat Template +UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::SETTINGS::SETTINGSPANELCHATTEMPLATES::T4025180906"] = "Delete Chat Template" + -- Delete UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::SETTINGS::SETTINGSPANELEMBEDDINGS::T1469573738"] = "Delete" @@ -1435,6 +1498,105 @@ UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::WORKSPACES::T474393241"] = "Please select -- Delete Workspace UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::WORKSPACES::T701874671"] = "Delete Workspace" +-- Only text content is supported in the editing mode yet. +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T1352914344"] = "Only text content is supported in the editing mode yet." + +-- Please enter a message for the example conversation. +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T1362948628"] = "Please enter a message for the example conversation." + +-- The chat template name must be unique; the chosen name is already in use. +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T1396308587"] = "The chat template name must be unique; the chosen name is already in use." + +-- Please enter a name for the chat template. +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T1548747185"] = "Please enter a name for the chat template." + +-- Update +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T1847791252"] = "Update" + +-- The chat template name must not exceed 40 characters. +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T204496403"] = "The chat template name must not exceed 40 characters." + +-- 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. +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T2292424657"] = "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 +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T2418769465"] = "Role" + +-- Tell the AI your system prompt. +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T2552381261"] = "Tell the AI your system prompt." + +-- No, prohibit profile use for this template +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T2579080722"] = "No, prohibit profile use for this template" + +-- Entry +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T2629823795"] = "Entry" + +-- Add +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T2646845972"] = "Add" + +-- The message +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T2719480499"] = "The message" + +-- Chat Template Name +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T275026390"] = "Chat Template Name" + +-- Commit Changes +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T2996302517"] = "Commit Changes" + +-- The name of the chat template is mandatory. Each chat template must have a unique name. +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T3016903701"] = "The name of the chat template is mandatory. Each chat template must have a unique name." + +-- Image content +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T3094908719"] = "Image content" + +-- Are you unsure which system prompt to use? You might start with the default system prompt that AI Studio uses for all chats. +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T3127437308"] = "Are you unsure which system prompt to use? You might start with the default system prompt that AI Studio uses for all chats." + +-- Using some chat templates in tandem with profiles might cause issues. Therefore, you might prohibit the usage of profiles here. +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T3227981830"] = "Using some chat templates in tandem with profiles might cause issues. Therefore, you might prohibit the usage of profiles here." + +-- Add a message +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T3372872324"] = "Add a message" + +-- Unsupported content type +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T3570316759"] = "Unsupported content type" + +-- What system prompt do you want to use? +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T3652587353"] = "What system prompt do you want to use?" + +-- Yes, allow profiles when using this template +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T3675108201"] = "Yes, allow profiles when using this template" + +-- Add a new message below +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T3757779731"] = "Add a new message below" + +-- Example Conversation +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T380891852"] = "Example Conversation" + +-- Actions +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T3865031940"] = "Actions" + +-- Messages per page +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T3893704289"] = "Messages per page" + +-- Use the default system prompt +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T4051106111"] = "Use the default system prompt" + +-- 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. +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T4199560726"] = "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." + +-- Enter a message +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T446374405"] = "Enter a message" + +-- System Prompt +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T628396066"] = "System Prompt" + +-- Allow the use of profiles together with this chat template? +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T823785464"] = "Allow the use of profiles together with this chat template?" + +-- Cancel +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T900713019"] = "Cancel" + -- No UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CONFIRMDIALOG::T1642511898"] = "No" @@ -2329,6 +2491,9 @@ UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGASSISTANTBIAS::T6790 -- When enabled, you can preselect options. This is might be useful when you prefer a specific language or LLM model. UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGASSISTANTBIAS::T711745239"] = "When enabled, you can preselect options. This is might be useful when you prefer a specific language or LLM model." +-- Preselect one of your chat templates? +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGCHAT::T1402022556"] = "Preselect one of your chat templates?" + -- Control how the LLM provider for loaded chats is selected and when assistant results are sent to chat. UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGCHAT::T172255919"] = "Control how the LLM provider for loaded chats is selected and when assistant results are sent to chat." @@ -2359,6 +2524,9 @@ UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGCHAT::T2913693228"] -- Do you want to use any shortcut to send your input? UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGCHAT::T2936560092"] = "Do you want to use any shortcut to send your input?" +-- Would you like to set one of your chat templates as the default for chats? +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGCHAT::T3234927721"] = "Would you like to set one of your chat templates as the default for chats?" + -- No chat options are preselected UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGCHAT::T3383186996"] = "No chat options are preselected" @@ -3637,6 +3805,9 @@ UI_TEXT_CONTENT["AISTUDIO::PROVIDER::LLMPROVIDERSEXTENSIONS::T3424652889"] = "Un -- no model selected UI_TEXT_CONTENT["AISTUDIO::PROVIDER::MODEL::T2234274832"] = "no model selected" +-- Use no chat template +UI_TEXT_CONTENT["AISTUDIO::SETTINGS::CHATTEMPLATE::T4258819635"] = "Use no chat template" + -- Navigation never expands, but there are tooltips UI_TEXT_CONTENT["AISTUDIO::SETTINGS::CONFIGURATIONSELECTDATAFACTORY::T1095779033"] = "Navigation never expands, but there are tooltips" diff --git a/app/MindWork AI Studio/Chat/ChatRole.cs b/app/MindWork AI Studio/Chat/ChatRole.cs index d292b71b..5c51769e 100644 --- a/app/MindWork AI Studio/Chat/ChatRole.cs +++ b/app/MindWork AI Studio/Chat/ChatRole.cs @@ -1,5 +1,3 @@ -using AIStudio.Tools.PluginSystem; - namespace AIStudio.Chat; /// @@ -14,68 +12,4 @@ public enum ChatRole USER, AI, AGENT, -} - -/// -/// Extensions for the ChatRole enum. -/// -public static class ExtensionsChatRole -{ - private static string TB(string fallbackEN) => I18N.I.T(fallbackEN, typeof(ChatRole).Namespace, nameof(ChatRole)); - - /// - /// Returns the name of the role. - /// - /// The role. - /// The name of the role. - public static string ToName(this ChatRole role) => role switch - { - ChatRole.SYSTEM => TB("System"), - ChatRole.USER => TB("You"), - ChatRole.AI => TB("AI"), - - _ => TB("Unknown"), - }; - - /// - /// Returns the color of the role. - /// - /// The role. - /// The color of the role. - public static Color ToColor(this ChatRole role) => role switch - { - ChatRole.SYSTEM => Color.Info, - ChatRole.USER => Color.Primary, - ChatRole.AI => Color.Tertiary, - - _ => Color.Error, - }; - - /// - /// Returns the icon of the role. - /// - /// The role. - /// The icon of the role. - public static string ToIcon(this ChatRole role) => role switch - { - ChatRole.SYSTEM => Icons.Material.Filled.Settings, - ChatRole.USER => Icons.Material.Filled.Person, - ChatRole.AI => Icons.Material.Filled.AutoAwesome, - - _ => Icons.Material.Filled.Help, - }; - - /// - /// Returns the specific name of the role for the chat template. - /// - /// The role. - /// The name of the role. - public static string ToChatTemplateName(this ChatRole role) => role switch - { - ChatRole.SYSTEM => TB("System"), - ChatRole.USER => TB("User"), - ChatRole.AI => TB("Assistant"), - - _ => TB("Unknown"), - }; } \ No newline at end of file diff --git a/app/MindWork AI Studio/Chat/ChatRoleExtensions.cs b/app/MindWork AI Studio/Chat/ChatRoleExtensions.cs new file mode 100644 index 00000000..40987d09 --- /dev/null +++ b/app/MindWork AI Studio/Chat/ChatRoleExtensions.cs @@ -0,0 +1,75 @@ +using AIStudio.Tools.PluginSystem; + +namespace AIStudio.Chat; + +public static class ChatRoleExtensions +{ + private static string TB(string fallbackEN) => I18N.I.T(fallbackEN, typeof(ChatRoleExtensions).Namespace, nameof(ChatRoleExtensions)); + + /// + /// Returns the name of the role. + /// + /// The role. + /// The name of the role. + public static string ToName(this ChatRole role) => role switch + { + ChatRole.SYSTEM => TB("System"), + ChatRole.USER => TB("You"), + ChatRole.AI => TB("AI"), + + _ => TB("Unknown"), + }; + + /// + /// Returns the color of the role. + /// + /// The role. + /// The color of the role. + public static Color ToColor(this ChatRole role) => role switch + { + ChatRole.SYSTEM => Color.Info, + ChatRole.USER => Color.Primary, + ChatRole.AI => Color.Tertiary, + + _ => Color.Error, + }; + + /// + /// Returns the icon of the role. + /// + /// The role. + /// The icon of the role. + public static string ToIcon(this ChatRole role) => role switch + { + ChatRole.SYSTEM => Icons.Material.Filled.Settings, + ChatRole.USER => Icons.Material.Filled.Person, + ChatRole.AI => Icons.Material.Filled.AutoAwesome, + + _ => Icons.Material.Filled.Help, + }; + + /// + /// Returns the specific name of the role for the chat template. + /// + /// The role. + /// The name of the role. + public static string ToChatTemplateName(this ChatRole role) => role switch + { + ChatRole.SYSTEM => TB("System"), + ChatRole.USER => TB("User"), + ChatRole.AI => TB("Assistant"), + + _ => TB("Unknown"), + }; + + /// + /// Selects the next role for a chat template. + /// + /// The current role. + /// The next role for the chat template. + public static ChatRole SelectNextRoleForTemplate(this ChatRole currentRole) => currentRole switch + { + ChatRole.USER => ChatRole.AI, + _ => ChatRole.USER, + }; +} \ No newline at end of file diff --git a/app/MindWork AI Studio/Chat/ChatThread.cs b/app/MindWork AI Studio/Chat/ChatThread.cs index adb64850..c57e5160 100644 --- a/app/MindWork AI Studio/Chat/ChatThread.cs +++ b/app/MindWork AI Studio/Chat/ChatThread.cs @@ -104,7 +104,7 @@ public sealed record ChatThread systemPromptTextWithChatTemplate = chatThread.SystemPrompt; else { - if(chatThread.SelectedChatTemplate == ChatTemplate.NO_CHATTEMPLATE.Id || chatTeamplateId == Guid.Empty) + if(chatThread.SelectedChatTemplate == ChatTemplate.NO_CHAT_TEMPLATE.Id || chatTeamplateId == Guid.Empty) systemPromptTextWithChatTemplate = chatThread.SystemPrompt; else { @@ -115,13 +115,12 @@ public sealed record ChatThread { logMessage = $"Using chat template '{chatTemplate.Name}' for chat thread '{chatThread.Name}'."; this.allowProfile = chatTemplate.AllowProfileUsage; - systemPromptTextWithChatTemplate = $""" - {chatTemplate.ToSystemPrompt()} - """; + systemPromptTextWithChatTemplate = chatTemplate.ToSystemPrompt(); } } } } + logger.LogInformation(logMessage); // @@ -146,11 +145,11 @@ public sealed record ChatThread // - // Add information from profile if available and allowed: + // Add information from the profile if available and allowed: // string systemPromptText; logMessage = $"Using no profile for chat thread '{chatThread.Name}'."; - if ((string.IsNullOrWhiteSpace(chatThread.SelectedProfile)) || (this.allowProfile is false)) + if (string.IsNullOrWhiteSpace(chatThread.SelectedProfile) || this.allowProfile is false) systemPromptText = systemPromptWithAugmentedData; else { diff --git a/app/MindWork AI Studio/Chat/ContentBlock.cs b/app/MindWork AI Studio/Chat/ContentBlock.cs index 0568d597..a069c3d8 100644 --- a/app/MindWork AI Studio/Chat/ContentBlock.cs +++ b/app/MindWork AI Studio/Chat/ContentBlock.cs @@ -28,17 +28,14 @@ public class ContentBlock /// /// Should the content block be hidden from the user? /// - public bool HideFromUser { get; set; } + public bool HideFromUser { get; init; } - public ContentBlock DeepClone() + public ContentBlock DeepClone() => new() { - return new() - { - Time = this.Time, - ContentType = this.ContentType, - Content = this.Content?.DeepClone(), - Role = this.Role, - HideFromUser = this.HideFromUser, - }; - } + Time = this.Time, + ContentType = this.ContentType, + Content = this.Content?.DeepClone(), + Role = this.Role, + HideFromUser = this.HideFromUser, + }; } \ No newline at end of file diff --git a/app/MindWork AI Studio/Chat/ContentImage.cs b/app/MindWork AI Studio/Chat/ContentImage.cs index 22eff248..6fcf7f1e 100644 --- a/app/MindWork AI Studio/Chat/ContentImage.cs +++ b/app/MindWork AI Studio/Chat/ContentImage.cs @@ -13,11 +13,11 @@ public sealed class ContentImage : IContent, IImageSource /// [JsonIgnore] - public bool InitialRemoteWait { get; set; } = false; + public bool InitialRemoteWait { get; set; } /// [JsonIgnore] - public bool IsStreaming { get; set; } = false; + public bool IsStreaming { get; set; } /// [JsonIgnore] @@ -34,16 +34,13 @@ public sealed class ContentImage : IContent, IImageSource } /// - public IContent DeepClone() + public IContent DeepClone() => new ContentImage { - return new ContentImage - { - Source = this.Source, - InitialRemoteWait = this.InitialRemoteWait, - IsStreaming = this.IsStreaming, - SourceType = this.SourceType, - }; - } + Source = this.Source, + InitialRemoteWait = this.InitialRemoteWait, + IsStreaming = this.IsStreaming, + SourceType = this.SourceType, + }; #endregion diff --git a/app/MindWork AI Studio/Chat/ContentText.cs b/app/MindWork AI Studio/Chat/ContentText.cs index 66166d7d..13d8f3ce 100644 --- a/app/MindWork AI Studio/Chat/ContentText.cs +++ b/app/MindWork AI Studio/Chat/ContentText.cs @@ -126,15 +126,12 @@ public sealed class ContentText : IContent } /// - public IContent DeepClone() + public IContent DeepClone() => new ContentText { - return new ContentText - { - Text = this.Text, - InitialRemoteWait = this.InitialRemoteWait, - IsStreaming = this.IsStreaming, - }; - } + Text = this.Text, + InitialRemoteWait = this.InitialRemoteWait, + IsStreaming = this.IsStreaming, + }; #endregion diff --git a/app/MindWork AI Studio/Components/ChatComponent.razor.cs b/app/MindWork AI Studio/Components/ChatComponent.razor.cs index 4d3f08cf..29b75f74 100644 --- a/app/MindWork AI Studio/Components/ChatComponent.razor.cs +++ b/app/MindWork AI Studio/Components/ChatComponent.razor.cs @@ -46,7 +46,7 @@ public partial class ChatComponent : MSGComponentBase, IAsyncDisposable private DataSourceSelection? dataSourceSelectionComponent; private DataSourceOptions earlyDataSourceOptions = new(); private Profile currentProfile = Profile.NO_PROFILE; - private ChatTemplate currentChatTemplate = ChatTemplate.NO_CHATTEMPLATE; + private ChatTemplate currentChatTemplate = ChatTemplate.NO_CHAT_TEMPLATE; private bool hasUnsavedChanges; private bool mustScrollToBottomAfterRender; private InnerScrolling scrollingArea = null!; @@ -329,7 +329,7 @@ public partial class ChatComponent : MSGComponentBase, IAsyncDisposable if(this.ChatThread is null) return; - await this.StartNewChat(true, false); + await this.StartNewChat(true); } private IReadOnlyList GetAgentSelectedDataSources() @@ -447,7 +447,12 @@ public partial class ChatComponent : MSGComponentBase, IAsyncDisposable // Update provider, profile and chat template: this.ChatThread.SelectedProvider = this.Provider.Id; this.ChatThread.SelectedProfile = this.currentProfile.Id; - this.ChatThread.SelectedChatTemplate = this.currentChatTemplate.Id; + + // + // Remark: We do not update the chat template here + // because the chat template is only used when starting a new chat. + // Updating the chat template afterward is not supported. + // } var time = DateTimeOffset.Now; @@ -804,7 +809,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.currentChatTemplate = ChatTemplate.NO_CHAT_TEMPLATE; } } diff --git a/app/MindWork AI Studio/Components/ChatTemplateSelection.razor b/app/MindWork AI Studio/Components/ChatTemplateSelection.razor index 3fe83a3f..ded0cd0f 100644 --- a/app/MindWork AI Studio/Components/ChatTemplateSelection.razor +++ b/app/MindWork AI Studio/Components/ChatTemplateSelection.razor @@ -1,12 +1,19 @@ @using AIStudio.Settings @inherits MSGComponentBase - + - - @(this.CurrentChatTemplate != ChatTemplate.NO_CHATTEMPLATE ? this.CurrentChatTemplate.Name : "") - + @if (this.CurrentChatTemplate != ChatTemplate.NO_CHAT_TEMPLATE) + { + + @this.CurrentChatTemplate.Name + + } + else + { + + } @foreach (var chatTemplate in this.SettingsManager.ConfigurationData.ChatTemplates.GetAllChatTemplates()) diff --git a/app/MindWork AI Studio/Components/ChatTemplateSelection.razor.cs b/app/MindWork AI Studio/Components/ChatTemplateSelection.razor.cs index 141fed74..73ca9e36 100644 --- a/app/MindWork AI Studio/Components/ChatTemplateSelection.razor.cs +++ b/app/MindWork AI Studio/Components/ChatTemplateSelection.razor.cs @@ -7,7 +7,7 @@ namespace AIStudio.Components; public partial class ChatTemplateSelection : MSGComponentBase { [Parameter] - public ChatTemplate CurrentChatTemplate { get; set; } = ChatTemplate.NO_CHATTEMPLATE; + public ChatTemplate CurrentChatTemplate { get; set; } = ChatTemplate.NO_CHAT_TEMPLATE; [Parameter] public EventCallback CurrentChatTemplateChanged { get; set; } diff --git a/app/MindWork AI Studio/Components/ProfileSelection.razor.cs b/app/MindWork AI Studio/Components/ProfileSelection.razor.cs index 649e2140..26f45a35 100644 --- a/app/MindWork AI Studio/Components/ProfileSelection.razor.cs +++ b/app/MindWork AI Studio/Components/ProfileSelection.razor.cs @@ -6,7 +6,7 @@ namespace AIStudio.Components; public partial class ProfileSelection : MSGComponentBase { - private static string TB(string fallbackEN) => I18N.I.T(fallbackEN, typeof(ConfigurationProviderSelection).Namespace, nameof(ConfigurationProviderSelection)); + private static string TB(string fallbackEN) => I18N.I.T(fallbackEN, typeof(ProfileSelection).Namespace, nameof(ProfileSelection)); [Parameter] public Profile CurrentProfile { get; set; } = Profile.NO_PROFILE; diff --git a/app/MindWork AI Studio/Components/Settings/SettingsPanelChatTemplates.razor b/app/MindWork AI Studio/Components/Settings/SettingsPanelChatTemplates.razor index 2851f659..b236e8a4 100644 --- a/app/MindWork AI Studio/Components/Settings/SettingsPanelChatTemplates.razor +++ b/app/MindWork AI Studio/Components/Settings/SettingsPanelChatTemplates.razor @@ -6,7 +6,7 @@ - @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("Customize your AI experience with 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 common AI companies' playgrounds, you can define your own system prompts and leverage assistant prompts for providers that support them.") diff --git a/app/MindWork AI Studio/Components/Settings/SettingsPanelChatTemplates.razor.cs b/app/MindWork AI Studio/Components/Settings/SettingsPanelChatTemplates.razor.cs index ba494cb8..30abfe54 100644 --- a/app/MindWork AI Studio/Components/Settings/SettingsPanelChatTemplates.razor.cs +++ b/app/MindWork AI Studio/Components/Settings/SettingsPanelChatTemplates.razor.cs @@ -37,8 +37,8 @@ public partial class SettingsPanelChatTemplates : SettingsPanelBase { x => x.DataName, chatTemplate.Name }, { x => x.DataSystemPrompt, chatTemplate.SystemPrompt }, { x => x.IsEditing, true }, - {x => x.ExampleConversation, chatTemplate.ExampleConversation}, - {x => x.AllowProfileUsage, chatTemplate.AllowProfileUsage}, + { x => x.ExampleConversation, chatTemplate.ExampleConversation }, + { x => x.AllowProfileUsage, chatTemplate.AllowProfileUsage }, }; var dialogReference = await this.DialogService.ShowAsync(T("Edit Chat Template"), dialogParameters, DialogOptions.FULLSCREEN); diff --git a/app/MindWork AI Studio/Dialogs/ChatTemplateDialog.razor b/app/MindWork AI Studio/Dialogs/ChatTemplateDialog.razor index b00221ff..61070a48 100644 --- a/app/MindWork AI Studio/Dialogs/ChatTemplateDialog.razor +++ b/app/MindWork AI Studio/Dialogs/ChatTemplateDialog.razor @@ -1,11 +1,8 @@ @using AIStudio.Chat -@using MudBlazor.Extensions @inherits MSGComponentBase -@inject ISnackbar Snackbar - @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.") @@ -31,34 +28,40 @@ Variant="Variant.Outlined" UserAttributes="@SPELLCHECK_ATTRIBUTES" /> + + + @T("System Prompt") + - - @T("Use the default system prompt") - + + @T("Are you unsure which system prompt to use? You might start with the default system prompt that AI Studio uses for all chats.") + + + @T("Use the default system prompt") + - - - + + @T("Using some chat templates in tandem with profiles might cause issues. Therefore, you might prohibit the usage of profiles here.") + + - + @T("Example Conversation") @@ -66,38 +69,73 @@ @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.") - + - + - + @T("Role") @T("Entry") - @T("Actions") + @T("Actions") - @context.Role.ToChatTemplateName() - - @(context.Content is ContentText textContent ? textContent.Text : context.Content?.ToString()) + + @context.Role.ToChatTemplateName() - - - + + @switch(context.Content) + { + case ContentText textContent: + + break; + + case ContentImage { SourceType: ContentImageSource.URL or ContentImageSource.LOCAL_PATH } imageContent: + + break; + + default: + @T("Unsupported content type") + break; + } + + + @if (!this.isInlineEditOnGoing) + { + + + + + + + } - - - @foreach (var role in availableRoles) + + + @foreach (var role in ChatRoles.ChatTemplateRoles()) { - @role.ToChatTemplateName() + + @role.ToChatTemplateName() + } - - + + @switch(context.Content) + { + case ContentText textContent: + + break; + + default: + + @T("Only text content is supported in the editing mode yet.") + + break; + } @@ -106,23 +144,32 @@ - @T("Add additional message") - + @if (!this.isInlineEditOnGoing) + { + + @T("Add a message") + + } + @T("Cancel") - - @if(this.IsEditing) - { - @T("Update") - } - else - { - @T("Add") - } - + + @if (!this.isInlineEditOnGoing) + { + + @if (this.IsEditing) + { + @T("Update") + } + else + { + @T("Add") + } + + } \ No newline at end of file diff --git a/app/MindWork AI Studio/Dialogs/ChatTemplateDialog.razor.cs b/app/MindWork AI Studio/Dialogs/ChatTemplateDialog.razor.cs index a113d7a0..af0f7560 100644 --- a/app/MindWork AI Studio/Dialogs/ChatTemplateDialog.razor.cs +++ b/app/MindWork AI Studio/Dialogs/ChatTemplateDialog.razor.cs @@ -42,13 +42,13 @@ public partial class ChatTemplateDialog : MSGComponentBase public bool IsEditing { get; init; } [Parameter] - public List ExampleConversation { get; set; } = []; + public IReadOnlyCollection ExampleConversation { get; init; } = []; [Parameter] public bool AllowProfileUsage { get; set; } = true; [Inject] - private ILogger Logger { get; init; } = null!; + private ILogger Logger { get; init; } = null!; private static readonly Dictionary SPELLCHECK_ATTRIBUTES = new(); @@ -58,88 +58,16 @@ public partial class ChatTemplateDialog : MSGComponentBase private List UsedNames { get; set; } = []; private bool dataIsValid; + private List dataExampleConversation = []; private string[] dataIssues = []; private string dataEditingPreviousName = string.Empty; + private bool isInlineEditOnGoing; - private ContentBlock messageEntryBeforeEdit; - private readonly IEnumerable availableRoles = ChatRoles.ChatTemplateRoles().ToArray(); + private ContentBlock? messageEntryBeforeEdit; // We get the form reference from Blazor code to validate it manually: private MudForm form = null!; - - private ChatTemplate CreateChatTemplateSettings() => new() - { - Num = this.DataNum, - Id = this.DataId, - - Name = this.DataName, - SystemPrompt = this.DataSystemPrompt, - ExampleConversation = this.ExampleConversation, - AllowProfileUsage = this.AllowProfileUsage, - }; - - private void RemoveMessage(ContentBlock item) - { - this.ExampleConversation.Remove(item); - } - - private void AddNewMessageToEnd() - { - this.ExampleConversation ??= new List(); - - var newEntry = new ContentBlock - { - Role = ChatRole.USER, // Default to User - Content = new ContentText(), - ContentType = ContentType.TEXT, - HideFromUser = true, - Time = DateTimeOffset.Now, - }; - - this.ExampleConversation.Add(newEntry); - } - - private void AddNewMessageBelow(ContentBlock currentItem) - { - - // Create new entry with a valid role - var newEntry = new ContentBlock - { - Role = ChatRole.USER, // Default to User - Content = new ContentText(), - ContentType = ContentType.TEXT, - HideFromUser = true, - Time = DateTimeOffset.Now, - }; - - // Rest of the method remains the same - var index = this.ExampleConversation.IndexOf(currentItem); - - if (index >= 0) - { - this.ExampleConversation.Insert(index + 1, newEntry); - } - else - { - this.ExampleConversation.Add(newEntry); - } - } - private void BackupItem(object element) - { - this.messageEntryBeforeEdit = new ContentBlock - { - Role = ((ContentBlock)element).Role, - Content = ((ContentBlock)element).Content, - }; - } - - private void ResetItemToOriginalValues(object element) - { - ((ContentBlock)element).Role = this.messageEntryBeforeEdit.Role; - ((ContentBlock)element).Content = this.messageEntryBeforeEdit.Content; - } - #region Overrides of ComponentBase protected override async Task OnInitializedAsync() @@ -154,6 +82,7 @@ public partial class ChatTemplateDialog : MSGComponentBase if(this.IsEditing) { this.dataEditingPreviousName = this.DataName.ToLowerInvariant(); + this.dataExampleConversation = this.ExampleConversation.Select(n => n.DeepClone()).ToList(); } await base.OnInitializedAsync(); @@ -170,6 +99,90 @@ public partial class ChatTemplateDialog : MSGComponentBase } #endregion + + private ChatTemplate CreateChatTemplateSettings() => new() + { + Num = this.DataNum, + Id = this.DataId, + + Name = this.DataName, + SystemPrompt = this.DataSystemPrompt, + ExampleConversation = this.dataExampleConversation, + AllowProfileUsage = this.AllowProfileUsage, + }; + + private void RemoveMessage(ContentBlock item) + { + this.dataExampleConversation.Remove(item); + } + + private void AddMessageToEnd() + { + var newEntry = new ContentBlock + { + Role = this.dataExampleConversation.Count is 0 ? ChatRole.USER : this.dataExampleConversation.Last().Role.SelectNextRoleForTemplate(), + Content = new ContentText(), + ContentType = ContentType.TEXT, + HideFromUser = true, + Time = DateTimeOffset.Now, + }; + + this.dataExampleConversation.Add(newEntry); + } + + private void AddMessageBelow(ContentBlock currentItem) + { + var insertedEntry = new ContentBlock + { + Role = this.dataExampleConversation.Count is 0 ? ChatRole.USER : this.dataExampleConversation.Last().Role.SelectNextRoleForTemplate(), + Content = new ContentText(), + ContentType = ContentType.TEXT, + HideFromUser = true, + Time = DateTimeOffset.Now, + }; + + // The rest of the method remains the same: + var index = this.dataExampleConversation.IndexOf(currentItem); + if (index >= 0) + this.dataExampleConversation.Insert(index + 1, insertedEntry); + else + this.dataExampleConversation.Add(insertedEntry); + } + + private void BackupItem(object? element) + { + this.isInlineEditOnGoing = true; + this.messageEntryBeforeEdit = element switch + { + ContentBlock block => block.DeepClone(), + _ => null, + }; + + this.StateHasChanged(); + } + + private void ResetItem(object? element) + { + this.isInlineEditOnGoing = false; + switch (element) + { + case ContentBlock block: + if (this.messageEntryBeforeEdit is null) + return; // No backup to restore from + + block.Content = this.messageEntryBeforeEdit.Content?.DeepClone(); + block.Role = this.messageEntryBeforeEdit.Role; + break; + } + + this.StateHasChanged(); + } + + private void CommitInlineEdit(object? element) + { + this.isInlineEditOnGoing = false; + this.StateHasChanged(); + } private async Task Store() { @@ -179,6 +192,10 @@ public partial class ChatTemplateDialog : MSGComponentBase if (!this.dataIsValid) return; + // When an inline edit is ongoing, we cannot store the data: + if (this.isInlineEditOnGoing) + return; + // Use the data model to store the chat template. // We just return this data to the parent component: var addedChatTemplateSettings = this.CreateChatTemplateSettings(); @@ -191,10 +208,10 @@ public partial class ChatTemplateDialog : MSGComponentBase this.MudDialog.Close(DialogResult.Ok(addedChatTemplateSettings)); } - private string? ValidateSystemPrompt(string text) + private string? ValidateExampleTextMessage(string message) { - if(text.Length > 444) - return T("The text must not exceed 444 characters."); + if (string.IsNullOrWhiteSpace(message)) + return T("Please enter a message for the example conversation."); return null; } diff --git a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogChat.razor b/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogChat.razor index 74d04b72..111b6a93 100644 --- a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogChat.razor +++ b/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogChat.razor @@ -19,6 +19,7 @@ + @if (PreviewFeatures.PRE_RAG_2024.IsEnabled(this.SettingsManager)) diff --git a/app/MindWork AI Studio/Plugins/languages/de-de-43065dbc-78d0-45b7-92be-f14c2926e2dc/plugin.lua b/app/MindWork AI Studio/Plugins/languages/de-de-43065dbc-78d0-45b7-92be-f14c2926e2dc/plugin.lua index 1d7ecf93..4ccbb053 100644 --- a/app/MindWork AI Studio/Plugins/languages/de-de-43065dbc-78d0-45b7-92be-f14c2926e2dc/plugin.lua +++ b/app/MindWork AI Studio/Plugins/languages/de-de-43065dbc-78d0-45b7-92be-f14c2926e2dc/plugin.lua @@ -654,6 +654,24 @@ UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::TRANSLATION::ASSISTANTTRANSLATION::T61388 -- Please provide a custom language. UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::TRANSLATION::ASSISTANTTRANSLATION::T656744944"] = "Bitte geben Sie eine eigene Sprache an." +-- System +UI_TEXT_CONTENT["AISTUDIO::CHAT::CHATROLEEXTENSIONS::T2402387132"] = "System" + +-- You +UI_TEXT_CONTENT["AISTUDIO::CHAT::CHATROLEEXTENSIONS::T3049115964"] = "Du" + +-- Unknown +UI_TEXT_CONTENT["AISTUDIO::CHAT::CHATROLEEXTENSIONS::T3424652889"] = "Unbekannt" + +-- Assistant +UI_TEXT_CONTENT["AISTUDIO::CHAT::CHATROLEEXTENSIONS::T3662687431"] = "Assistent" + +-- User +UI_TEXT_CONTENT["AISTUDIO::CHAT::CHATROLEEXTENSIONS::T3768991250"] = "Benutzer" + +-- AI +UI_TEXT_CONTENT["AISTUDIO::CHAT::CHATROLEEXTENSIONS::T601166687"] = "KI" + -- Edit Message UI_TEXT_CONTENT["AISTUDIO::CHAT::CONTENTBLOCKCOMPONENT::T1183581066"] = "Nachricht bearbeiten" @@ -726,6 +744,9 @@ UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::CHATCOMPONENT::T1849313532"] = "Geben Sie -- Your Prompt (use selected instance '{0}', provider '{1}') UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::CHATCOMPONENT::T1967611328"] = "Ihr Prompt (verwendete Instanz: '{0}', Anbieter: '{1}')" +-- Profile usage is disabled according to your chat template settings. +UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::CHATCOMPONENT::T2670286472"] = "Die Profilnutzung ist gemäß den Einstellungen Ihrer Chat-Vorlage deaktiviert." + -- Delete this chat & start a new one. UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::CHATCOMPONENT::T2991985411"] = "Diesen Chat löschen & einen neuen beginnen." @@ -753,6 +774,9 @@ UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::CHATCOMPONENT::T636393754"] = "Verschiebe -- Show your workspaces UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::CHATCOMPONENT::T733672375"] = "Ihre Arbeitsbereiche anzeigen" +-- Start a new chat with a chat template +UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::CHATTEMPLATESELECTION::T1333844707"] = "Neuen Chat mit einer Chat-Vorlage starten" + -- Region UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::CONFIDENCEINFO::T1227782301"] = "Region" @@ -1065,6 +1089,45 @@ UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::SETTINGS::SETTINGSPANELAPP::T817101267"] -- Would you like to set one provider as the default for the entire app? When you configure a different provider for an assistant, it will always take precedence. UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::SETTINGS::SETTINGSPANELAPP::T844514734"] = "Möchten Sie einen Anbieter als Standard für die gesamte App festlegen? Wenn Sie einen anderen Anbieter für einen Assistenten konfigurieren, hat dieser immer Vorrang." +-- Customize your AI experience with 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 common AI companies' playgrounds, you can define your own system prompts and leverage assistant prompts for providers that support them. +UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::SETTINGS::SETTINGSPANELCHATTEMPLATES::T1172171653"] = "Passen Sie Ihre KI-Erfahrung mit Chat-Vorlagen an. Egal, ob Sie mit Prompt-Engineering experimentieren, einfach einen eigenen System-Prompt im normalen Chat verwenden oder einen spezialisierten Assistenten erstellen möchten – mit unseren Vorlagen haben Sie die volle Kontrolle. Ähnlich wie in den Playgrounds gängiger KI-Anbieter können Sie eigene System-Prompts festlegen und bei unterstützenden Anbietern auch Assistenten-Prompts nutzen." + +-- Delete +UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::SETTINGS::SETTINGSPANELCHATTEMPLATES::T1469573738"] = "Löschen" + +-- Add Chat Template +UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::SETTINGS::SETTINGSPANELCHATTEMPLATES::T1548314416"] = "Chat-Vorlage hinzufügen" + +-- 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. +UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::SETTINGS::SETTINGSPANELCHATTEMPLATES::T1909110760"] = "Hinweis: Diese fortgeschrittene Funktion richtet sich an Nutzer, die mit den Grundlagen des Prompt Engineerings vertraut sind. Außerdem müssen Sie selbst sicherstellen, dass Ihr gewählter Anbieter die Verwendung von Assistenten-Prompts unterstützt." + +-- No chat templates configured yet. +UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::SETTINGS::SETTINGSPANELCHATTEMPLATES::T2319860307"] = "Noch keine Chat-Vorlagen konfiguriert." + +-- Configure Chat Templates +UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::SETTINGS::SETTINGSPANELCHATTEMPLATES::T2453567568"] = "Chat-Vorlagen konfigurieren" + +-- Chat Template Name +UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::SETTINGS::SETTINGSPANELCHATTEMPLATES::T275026390"] = "Name der Chat-Vorlage" + +-- Are you sure you want to delete the chat template '{0}'? +UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::SETTINGS::SETTINGSPANELCHATTEMPLATES::T3102555824"] = "Sind Sie sicher, dass Sie die Chat-Vorlage „{0}“ löschen möchten?" + +-- Edit +UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::SETTINGS::SETTINGSPANELCHATTEMPLATES::T3267849393"] = "Bearbeiten" + +-- Edit Chat Template +UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::SETTINGS::SETTINGSPANELCHATTEMPLATES::T3596030597"] = "Chat-Vorlage bearbeiten" + +-- Your Chat Templates +UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::SETTINGS::SETTINGSPANELCHATTEMPLATES::T3824122683"] = "Ihre Chat-Vorlagen" + +-- Actions +UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::SETTINGS::SETTINGSPANELCHATTEMPLATES::T3865031940"] = "Aktionen" + +-- Delete Chat Template +UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::SETTINGS::SETTINGSPANELCHATTEMPLATES::T4025180906"] = "Chat-Vorlage löschen" + -- Delete UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::SETTINGS::SETTINGSPANELEMBEDDINGS::T1469573738"] = "Löschen" @@ -1437,6 +1500,105 @@ UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::WORKSPACES::T474393241"] = "Bitte wählen -- Delete Workspace UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::WORKSPACES::T701874671"] = "Arbeitsbereich löschen" +-- Only text content is supported in the editing mode yet. +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T1352914344"] = "Im Bearbeitungsmodus wird bisher nur Textinhalt unterstützt." + +-- Please enter a message for the example conversation. +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T1362948628"] = "Bitte gib eine Nachricht für die Beispiel-Konversation ein." + +-- The chat template name must be unique; the chosen name is already in use. +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T1396308587"] = "Der Name der Chat-Vorlage muss eindeutig sein; der gewählte Name wird bereits verwendet." + +-- Please enter a name for the chat template. +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T1548747185"] = "Bitte geben Sie einen Namen für die Chat-Vorlage ein." + +-- Update +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T1847791252"] = "Aktualisieren" + +-- The chat template name must not exceed 40 characters. +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T204496403"] = "Der Name der Chat-Vorlage darf maximal 40 Zeichen lang sein." + +-- 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. +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T2292424657"] = "Fügen Sie Nachrichten einer Beispiel-Konversation hinzu (Nutzereingabe, gefolgt von einer Antwort des Assistenten), um das gewünschte Interaktionsmuster zu demonstrieren. Diese Beispiele helfen der KI, Ihre Erwartungen zu verstehen, indem Sie das korrekte Format, den Stil und den Inhalt von Antworten zeigen, bevor tatsächliche Nutzereingaben erfolgen." + +-- Role +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T2418769465"] = "Rolle" + +-- Tell the AI your system prompt. +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T2552381261"] = "Teilen Sie der KI einen System-Prompt mit." + +-- No, prohibit profile use for this template +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T2579080722"] = "Nein, die Profilnutzung für diese Vorlage verbieten" + +-- Entry +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T2629823795"] = "Eintrag" + +-- Add +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T2646845972"] = "Hinzufügen" + +-- The message +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T2719480499"] = "Die Nachricht" + +-- Chat Template Name +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T275026390"] = "Name der Chat-Vorlage" + +-- Commit Changes +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T2996302517"] = "Änderungen übernehmen" + +-- The name of the chat template is mandatory. Each chat template must have a unique name. +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T3016903701"] = "Der Name der Chat-Vorlage ist erforderlich. Jede Chat-Vorlage muss einen eindeutigen Namen haben." + +-- Image content +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T3094908719"] = "Bildinhalt" + +-- Are you unsure which system prompt to use? You might start with the default system prompt that AI Studio uses for all chats. +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T3127437308"] = "Sind Sie unsicher, welchen System-Prompt Sie verwenden sollen? Sie können mit dem Standard-System-Prompt beginnen, den AI Studio für alle Chats verwendet." + +-- Using some chat templates in tandem with profiles might cause issues. Therefore, you might prohibit the usage of profiles here. +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T3227981830"] = "Die gleichzeitige Verwendung einiger Chat-Vorlagen mit Profilen kann zu Problemen führen. Deshalb könnten Sie hier die Nutzung von Profilen untersagen." + +-- Add a message +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T3372872324"] = "Nachricht hinzufügen" + +-- Unsupported content type +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T3570316759"] = "Nicht unterstützter Inhaltstyp" + +-- What system prompt do you want to use? +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T3652587353"] = "Welchen System-Prompt möchten Sie verwenden?" + +-- Yes, allow profiles when using this template +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T3675108201"] = "Ja, Profile bei Verwendung dieser Vorlage zulassen" + +-- Add a new message below +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T3757779731"] = "Neue Nachricht unten hinzufügen" + +-- Example Conversation +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T380891852"] = "Beispiel-Konversation" + +-- Actions +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T3865031940"] = "Aktionen" + +-- Messages per page +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T3893704289"] = "Nachrichten pro Seite" + +-- Use the default system prompt +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T4051106111"] = "Verwenden Sie den Standard-System-Prompt" + +-- 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. +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T4199560726"] = "Erstellen Sie Ihre eigene Chat-Vorlage, um das Verhalten des LLMs für bestimmte Aufgaben oder Bereiche anzupassen. Definieren Sie einen individuellen System-Prompt und geben Sie eine Beispiel-Konversation vor, um eine KI-Erfahrung zu gestalten, die genau auf Ihre Anforderungen zugeschnitten ist." + +-- Enter a message +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T446374405"] = "Nachricht eingeben" + +-- System Prompt +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T628396066"] = "System-Prompt" + +-- Allow the use of profiles together with this chat template? +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T823785464"] = "Erlauben Sie die Verwendung von Profilen zusammen mit dieser Chat-Vorlage?" + +-- Cancel +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T900713019"] = "Abbrechen" + -- No UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CONFIRMDIALOG::T1642511898"] = "Nein" @@ -2331,6 +2493,9 @@ UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGASSISTANTBIAS::T6790 -- When enabled, you can preselect options. This is might be useful when you prefer a specific language or LLM model. UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGASSISTANTBIAS::T711745239"] = "Wenn diese Option aktiviert ist, kannst du Voreinstellungen treffen. Das kann nützlich sein, wenn du eine bestimmte Sprache oder ein bestimmtes LLM-Modell bevorzugst." +-- Preselect one of your chat templates? +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGCHAT::T1402022556"] = "Eine deiner Chat-Vorlagen vorab auswählen?" + -- Control how the LLM provider for loaded chats is selected and when assistant results are sent to chat. UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGCHAT::T172255919"] = "Legen Sie fest, wie der LLM-Anbieter für geladene Chats ausgewählt wird und wann Assistenten-Ergebnisse an den Chat gesendet werden." @@ -2361,6 +2526,9 @@ UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGCHAT::T2913693228"] -- Do you want to use any shortcut to send your input? UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGCHAT::T2936560092"] = "Möchten Sie eine Tastenkombination verwenden, um Ihre Eingabe zu senden?" +-- Would you like to set one of your chat templates as the default for chats? +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGCHAT::T3234927721"] = "Möchten Sie eine Ihrer Chat-Vorlagen als Standard für alle Chats festlegen?" + -- No chat options are preselected UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGCHAT::T3383186996"] = "Keine Chat-Optionen sind vorausgewählt" @@ -3639,6 +3807,9 @@ UI_TEXT_CONTENT["AISTUDIO::PROVIDER::LLMPROVIDERSEXTENSIONS::T3424652889"] = "Un -- no model selected UI_TEXT_CONTENT["AISTUDIO::PROVIDER::MODEL::T2234274832"] = "Kein Modell ausgewählt" +-- Use no chat template +UI_TEXT_CONTENT["AISTUDIO::SETTINGS::CHATTEMPLATE::T4258819635"] = "Keine Chat-Vorlage verwenden" + -- Navigation never expands, but there are tooltips UI_TEXT_CONTENT["AISTUDIO::SETTINGS::CONFIGURATIONSELECTDATAFACTORY::T1095779033"] = "Die Navigationsleiste wird nie ausgeklappt, aber es gibt Tooltips" diff --git a/app/MindWork AI Studio/Plugins/languages/en-us-97dfb1ba-50c4-4440-8dfa-6575daf543c8/plugin.lua b/app/MindWork AI Studio/Plugins/languages/en-us-97dfb1ba-50c4-4440-8dfa-6575daf543c8/plugin.lua index 92f3677f..bdf2e0fc 100644 --- a/app/MindWork AI Studio/Plugins/languages/en-us-97dfb1ba-50c4-4440-8dfa-6575daf543c8/plugin.lua +++ b/app/MindWork AI Studio/Plugins/languages/en-us-97dfb1ba-50c4-4440-8dfa-6575daf543c8/plugin.lua @@ -654,6 +654,24 @@ UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::TRANSLATION::ASSISTANTTRANSLATION::T61388 -- Please provide a custom language. UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::TRANSLATION::ASSISTANTTRANSLATION::T656744944"] = "Please provide a custom language." +-- System +UI_TEXT_CONTENT["AISTUDIO::CHAT::CHATROLEEXTENSIONS::T2402387132"] = "System" + +-- You +UI_TEXT_CONTENT["AISTUDIO::CHAT::CHATROLEEXTENSIONS::T3049115964"] = "You" + +-- Unknown +UI_TEXT_CONTENT["AISTUDIO::CHAT::CHATROLEEXTENSIONS::T3424652889"] = "Unknown" + +-- Assistant +UI_TEXT_CONTENT["AISTUDIO::CHAT::CHATROLEEXTENSIONS::T3662687431"] = "Assistant" + +-- User +UI_TEXT_CONTENT["AISTUDIO::CHAT::CHATROLEEXTENSIONS::T3768991250"] = "User" + +-- AI +UI_TEXT_CONTENT["AISTUDIO::CHAT::CHATROLEEXTENSIONS::T601166687"] = "AI" + -- Edit Message UI_TEXT_CONTENT["AISTUDIO::CHAT::CONTENTBLOCKCOMPONENT::T1183581066"] = "Edit Message" @@ -726,6 +744,9 @@ UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::CHATCOMPONENT::T1849313532"] = "Type your -- Your Prompt (use selected instance '{0}', provider '{1}') UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::CHATCOMPONENT::T1967611328"] = "Your Prompt (use selected instance '{0}', provider '{1}')" +-- Profile usage is disabled according to your chat template settings. +UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::CHATCOMPONENT::T2670286472"] = "Profile usage is disabled according to your chat template settings." + -- Delete this chat & start a new one. UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::CHATCOMPONENT::T2991985411"] = "Delete this chat & start a new one." @@ -753,6 +774,9 @@ UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::CHATCOMPONENT::T636393754"] = "Move the c -- Show your workspaces UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::CHATCOMPONENT::T733672375"] = "Show your workspaces" +-- Start a new chat with a chat template +UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::CHATTEMPLATESELECTION::T1333844707"] = "Start a new chat with a chat template" + -- Region UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::CONFIDENCEINFO::T1227782301"] = "Region" @@ -1065,6 +1089,45 @@ UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::SETTINGS::SETTINGSPANELAPP::T817101267"] -- Would you like to set one provider as the default for the entire app? When you configure a different provider for an assistant, it will always take precedence. UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::SETTINGS::SETTINGSPANELAPP::T844514734"] = "Would you like to set one provider as the default for the entire app? When you configure a different provider for an assistant, it will always take precedence." +-- Customize your AI experience with 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 common AI companies' playgrounds, you can define your own system prompts and leverage assistant prompts for providers that support them. +UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::SETTINGS::SETTINGSPANELCHATTEMPLATES::T1172171653"] = "Customize your AI experience with 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 common AI companies' playgrounds, you can define your own system prompts and leverage assistant prompts for providers that support them." + +-- Delete +UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::SETTINGS::SETTINGSPANELCHATTEMPLATES::T1469573738"] = "Delete" + +-- Add Chat Template +UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::SETTINGS::SETTINGSPANELCHATTEMPLATES::T1548314416"] = "Add Chat Template" + +-- 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. +UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::SETTINGS::SETTINGSPANELCHATTEMPLATES::T1909110760"] = "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." + +-- No chat templates configured yet. +UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::SETTINGS::SETTINGSPANELCHATTEMPLATES::T2319860307"] = "No chat templates configured yet." + +-- Configure Chat Templates +UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::SETTINGS::SETTINGSPANELCHATTEMPLATES::T2453567568"] = "Configure Chat Templates" + +-- Chat Template Name +UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::SETTINGS::SETTINGSPANELCHATTEMPLATES::T275026390"] = "Chat Template Name" + +-- Are you sure you want to delete the chat template '{0}'? +UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::SETTINGS::SETTINGSPANELCHATTEMPLATES::T3102555824"] = "Are you sure you want to delete the chat template '{0}'?" + +-- Edit +UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::SETTINGS::SETTINGSPANELCHATTEMPLATES::T3267849393"] = "Edit" + +-- Edit Chat Template +UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::SETTINGS::SETTINGSPANELCHATTEMPLATES::T3596030597"] = "Edit Chat Template" + +-- Your Chat Templates +UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::SETTINGS::SETTINGSPANELCHATTEMPLATES::T3824122683"] = "Your Chat Templates" + +-- Actions +UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::SETTINGS::SETTINGSPANELCHATTEMPLATES::T3865031940"] = "Actions" + +-- Delete Chat Template +UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::SETTINGS::SETTINGSPANELCHATTEMPLATES::T4025180906"] = "Delete Chat Template" + -- Delete UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::SETTINGS::SETTINGSPANELEMBEDDINGS::T1469573738"] = "Delete" @@ -1437,6 +1500,105 @@ UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::WORKSPACES::T474393241"] = "Please select -- Delete Workspace UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::WORKSPACES::T701874671"] = "Delete Workspace" +-- Only text content is supported in the editing mode yet. +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T1352914344"] = "Only text content is supported in the editing mode yet." + +-- Please enter a message for the example conversation. +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T1362948628"] = "Please enter a message for the example conversation." + +-- The chat template name must be unique; the chosen name is already in use. +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T1396308587"] = "The chat template name must be unique; the chosen name is already in use." + +-- Please enter a name for the chat template. +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T1548747185"] = "Please enter a name for the chat template." + +-- Update +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T1847791252"] = "Update" + +-- The chat template name must not exceed 40 characters. +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T204496403"] = "The chat template name must not exceed 40 characters." + +-- 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. +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T2292424657"] = "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 +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T2418769465"] = "Role" + +-- Tell the AI your system prompt. +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T2552381261"] = "Tell the AI your system prompt." + +-- No, prohibit profile use for this template +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T2579080722"] = "No, prohibit profile use for this template" + +-- Entry +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T2629823795"] = "Entry" + +-- Add +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T2646845972"] = "Add" + +-- The message +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T2719480499"] = "The message" + +-- Chat Template Name +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T275026390"] = "Chat Template Name" + +-- Commit Changes +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T2996302517"] = "Commit Changes" + +-- The name of the chat template is mandatory. Each chat template must have a unique name. +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T3016903701"] = "The name of the chat template is mandatory. Each chat template must have a unique name." + +-- Image content +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T3094908719"] = "Image content" + +-- Are you unsure which system prompt to use? You might start with the default system prompt that AI Studio uses for all chats. +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T3127437308"] = "Are you unsure which system prompt to use? You might start with the default system prompt that AI Studio uses for all chats." + +-- Using some chat templates in tandem with profiles might cause issues. Therefore, you might prohibit the usage of profiles here. +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T3227981830"] = "Using some chat templates in tandem with profiles might cause issues. Therefore, you might prohibit the usage of profiles here." + +-- Add a message +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T3372872324"] = "Add a message" + +-- Unsupported content type +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T3570316759"] = "Unsupported content type" + +-- What system prompt do you want to use? +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T3652587353"] = "What system prompt do you want to use?" + +-- Yes, allow profiles when using this template +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T3675108201"] = "Yes, allow profiles when using this template" + +-- Add a new message below +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T3757779731"] = "Add a new message below" + +-- Example Conversation +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T380891852"] = "Example Conversation" + +-- Actions +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T3865031940"] = "Actions" + +-- Messages per page +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T3893704289"] = "Messages per page" + +-- Use the default system prompt +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T4051106111"] = "Use the default system prompt" + +-- 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. +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T4199560726"] = "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." + +-- Enter a message +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T446374405"] = "Enter a message" + +-- System Prompt +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T628396066"] = "System Prompt" + +-- Allow the use of profiles together with this chat template? +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T823785464"] = "Allow the use of profiles together with this chat template?" + +-- Cancel +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CHATTEMPLATEDIALOG::T900713019"] = "Cancel" + -- No UI_TEXT_CONTENT["AISTUDIO::DIALOGS::CONFIRMDIALOG::T1642511898"] = "No" @@ -2331,6 +2493,9 @@ UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGASSISTANTBIAS::T6790 -- When enabled, you can preselect options. This is might be useful when you prefer a specific language or LLM model. UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGASSISTANTBIAS::T711745239"] = "When enabled, you can preselect options. This is might be useful when you prefer a specific language or LLM model." +-- Preselect one of your chat templates? +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGCHAT::T1402022556"] = "Preselect one of your chat templates?" + -- Control how the LLM provider for loaded chats is selected and when assistant results are sent to chat. UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGCHAT::T172255919"] = "Control how the LLM provider for loaded chats is selected and when assistant results are sent to chat." @@ -2361,6 +2526,9 @@ UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGCHAT::T2913693228"] -- Do you want to use any shortcut to send your input? UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGCHAT::T2936560092"] = "Do you want to use any shortcut to send your input?" +-- Would you like to set one of your chat templates as the default for chats? +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGCHAT::T3234927721"] = "Would you like to set one of your chat templates as the default for chats?" + -- No chat options are preselected UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGCHAT::T3383186996"] = "No chat options are preselected" @@ -3639,6 +3807,9 @@ UI_TEXT_CONTENT["AISTUDIO::PROVIDER::LLMPROVIDERSEXTENSIONS::T3424652889"] = "Un -- no model selected UI_TEXT_CONTENT["AISTUDIO::PROVIDER::MODEL::T2234274832"] = "no model selected" +-- Use no chat template +UI_TEXT_CONTENT["AISTUDIO::SETTINGS::CHATTEMPLATE::T4258819635"] = "Use no chat template" + -- Navigation never expands, but there are tooltips UI_TEXT_CONTENT["AISTUDIO::SETTINGS::CONFIGURATIONSELECTDATAFACTORY::T1095779033"] = "Navigation never expands, but there are tooltips" diff --git a/app/MindWork AI Studio/Settings/ChatTemplate.cs b/app/MindWork AI Studio/Settings/ChatTemplate.cs index 39c1271f..0c52568a 100644 --- a/app/MindWork AI Studio/Settings/ChatTemplate.cs +++ b/app/MindWork AI Studio/Settings/ChatTemplate.cs @@ -7,7 +7,7 @@ public readonly record struct ChatTemplate(uint Num, string Id, string Name, str { private static string TB(string fallbackEN) => I18N.I.T(fallbackEN, typeof(ChatTemplate).Namespace, nameof(ChatTemplate)); - public static readonly ChatTemplate NO_CHATTEMPLATE = new() + public static readonly ChatTemplate NO_CHAT_TEMPLATE = new() { Name = TB("Use no chat template"), SystemPrompt = string.Empty, @@ -34,5 +34,4 @@ public readonly record struct ChatTemplate(uint Num, string Id, string Name, str return this.SystemPrompt; } - } \ No newline at end of file diff --git a/app/MindWork AI Studio/Settings/SettingsManager.cs b/app/MindWork AI Studio/Settings/SettingsManager.cs index e10e37bb..19423a6e 100644 --- a/app/MindWork AI Studio/Settings/SettingsManager.cs +++ b/app/MindWork AI Studio/Settings/SettingsManager.cs @@ -273,7 +273,7 @@ public sealed class SettingsManager return preselection; preselection = this.ConfigurationData.ChatTemplates.FirstOrDefault(x => x.Id == this.ConfigurationData.App.PreselectedChatTemplate); - return preselection != default ? preselection : ChatTemplate.NO_CHATTEMPLATE; + return preselection != default ? preselection : ChatTemplate.NO_CHAT_TEMPLATE; } public ConfidenceLevel GetConfiguredConfidenceLevel(LLMProviders llmProvider) diff --git a/app/MindWork AI Studio/Tools/ChatTemplateExtensions.cs b/app/MindWork AI Studio/Tools/ChatTemplateExtensions.cs index b7b2f183..28b5f4e7 100644 --- a/app/MindWork AI Studio/Tools/ChatTemplateExtensions.cs +++ b/app/MindWork AI Studio/Tools/ChatTemplateExtensions.cs @@ -6,7 +6,7 @@ public static class ChatTemplateExtensions { public static IEnumerable GetAllChatTemplates(this IEnumerable chatTemplates) { - yield return ChatTemplate.NO_CHATTEMPLATE; + yield return ChatTemplate.NO_CHAT_TEMPLATE; foreach (var chatTemplate in chatTemplates) yield return chatTemplate; } diff --git a/app/MindWork AI Studio/wwwroot/changelog/v0.9.45.md b/app/MindWork AI Studio/wwwroot/changelog/v0.9.45.md index 74af88a3..ad22ca78 100644 --- a/app/MindWork AI Studio/wwwroot/changelog/v0.9.45.md +++ b/app/MindWork AI Studio/wwwroot/changelog/v0.9.45.md @@ -1,2 +1,3 @@ # v0.9.45, build 220 (2025-05-xx xx:xx UTC) +- Added chat templates. They are similar to common AI companies' playgrounds, where you can define your own system prompts and leverage assistant prompts for providers that support them. We thank Peer `peerschuett` for the work on this feature. - Improved chat options: you can access them directly from the chat interface. \ No newline at end of file