diff --git a/app/MindWork AI Studio/Components/ChatComponent.razor.cs b/app/MindWork AI Studio/Components/ChatComponent.razor.cs
index c1d36f32..addded22 100644
--- a/app/MindWork AI Studio/Components/ChatComponent.razor.cs
+++ b/app/MindWork AI Studio/Components/ChatComponent.razor.cs
@@ -673,6 +673,8 @@ public partial class ChatComponent : MSGComponentBase, IAsyncDisposable
Seed = this.RNG.Next(),
Blocks = this.currentChatTemplate == default ? [] : this.currentChatTemplate.ExampleConversation.Select(x => x.DeepClone()).ToList(),
};
+
+ this.userInput = this.currentChatTemplate.PredefinedUserPrompt;
}
// Now, we have to reset the data source options as well:
diff --git a/app/MindWork AI Studio/Dialogs/ChatTemplateDialog.razor b/app/MindWork AI Studio/Dialogs/ChatTemplateDialog.razor
index 61070a48..a4db8b5b 100644
--- a/app/MindWork AI Studio/Dialogs/ChatTemplateDialog.razor
+++ b/app/MindWork AI Studio/Dialogs/ChatTemplateDialog.razor
@@ -56,6 +56,34 @@
@T("Use the default system prompt")
+
+ @T("Predefined User Input")
+
+
+
+ @T("You might want to predefine a first message that will be copied into the user prompt, when you use this chat template. This message could for example be a blueprint for a structured message that this chat template is defined to work with.")
+
+
+
+
+
+ @T("Profile Usage")
+
+
@T("Using some chat templates in tandem with profiles might cause issues. Therefore, you might prohibit the usage of profiles here.")
@@ -69,6 +97,7 @@
@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.")
+
diff --git a/app/MindWork AI Studio/Dialogs/ChatTemplateDialog.razor.cs b/app/MindWork AI Studio/Dialogs/ChatTemplateDialog.razor.cs
index af0f7560..7a8b6765 100644
--- a/app/MindWork AI Studio/Dialogs/ChatTemplateDialog.razor.cs
+++ b/app/MindWork AI Studio/Dialogs/ChatTemplateDialog.razor.cs
@@ -35,6 +35,12 @@ public partial class ChatTemplateDialog : MSGComponentBase
[Parameter]
public string DataSystemPrompt { get; set; } = string.Empty;
+ ///
+ /// What is the predefined user prompt?
+ ///
+ [Parameter]
+ public string PredefinedUserPrompt { get; set; } = string.Empty;
+
///
/// Should the dialog be in editing mode?
///
@@ -107,6 +113,7 @@ public partial class ChatTemplateDialog : MSGComponentBase
Name = this.DataName,
SystemPrompt = this.DataSystemPrompt,
+ PredefinedUserPrompt = this.PredefinedUserPrompt,
ExampleConversation = this.dataExampleConversation,
AllowProfileUsage = this.AllowProfileUsage,
};
diff --git a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogChatTemplate.razor.cs b/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogChatTemplate.razor.cs
index df45daae..8ca3118a 100644
--- a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogChatTemplate.razor.cs
+++ b/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogChatTemplate.razor.cs
@@ -33,6 +33,7 @@ public partial class SettingsDialogChatTemplate : SettingsDialogBase
{ x => x.DataId, chatTemplate.Id },
{ x => x.DataName, chatTemplate.Name },
{ x => x.DataSystemPrompt, chatTemplate.SystemPrompt },
+ { x => x.PredefinedUserPrompt, chatTemplate.PredefinedUserPrompt },
{ x => x.IsEditing, true },
{ x => x.ExampleConversation, chatTemplate.ExampleConversation },
{ x => x.AllowProfileUsage, chatTemplate.AllowProfileUsage },
diff --git a/app/MindWork AI Studio/Settings/ChatTemplate.cs b/app/MindWork AI Studio/Settings/ChatTemplate.cs
index 0c52568a..02e0061c 100644
--- a/app/MindWork AI Studio/Settings/ChatTemplate.cs
+++ b/app/MindWork AI Studio/Settings/ChatTemplate.cs
@@ -3,7 +3,7 @@ using AIStudio.Tools.PluginSystem;
namespace AIStudio.Settings;
-public readonly record struct ChatTemplate(uint Num, string Id, string Name, string SystemPrompt, List ExampleConversation, bool AllowProfileUsage)
+public readonly record struct ChatTemplate(uint Num, string Id, string Name, string SystemPrompt, string PredefinedUserPrompt, List ExampleConversation, bool AllowProfileUsage)
{
private static string TB(string fallbackEN) => I18N.I.T(fallbackEN, typeof(ChatTemplate).Namespace, nameof(ChatTemplate));
@@ -11,6 +11,7 @@ public readonly record struct ChatTemplate(uint Num, string Id, string Name, str
{
Name = TB("Use no chat template"),
SystemPrompt = string.Empty,
+ PredefinedUserPrompt = string.Empty,
Id = Guid.Empty.ToString(),
Num = uint.MaxValue,
ExampleConversation = [],