diff --git a/app/MindWork AI Studio/Components/ChatComponent.razor.cs b/app/MindWork AI Studio/Components/ChatComponent.razor.cs index 8d12159b..72c20ebe 100644 --- a/app/MindWork AI Studio/Components/ChatComponent.razor.cs +++ b/app/MindWork AI Studio/Components/ChatComponent.razor.cs @@ -435,7 +435,7 @@ public partial class ChatComponent : MSGComponentBase, IAsyncDisposable DataSourceOptions = this.earlyDataSourceOptions, Name = this.ExtractThreadName(this.userInput), Seed = this.RNG.Next(), - Blocks = this.currentChatTemplate == default ? [] : this.currentChatTemplate.AdditionalMessages.Select(x => x.DeepClone()).ToList(), + Blocks = this.currentChatTemplate == default ? [] : this.currentChatTemplate.ExampleConversation.Select(x => x.DeepClone()).ToList(), }; await this.ChatThreadChanged.InvokeAsync(this.ChatThread); @@ -666,7 +666,7 @@ public partial class ChatComponent : MSGComponentBase, IAsyncDisposable ChatId = Guid.NewGuid(), Name = string.Empty, Seed = this.RNG.Next(), - Blocks = this.currentChatTemplate == default ? [] : this.currentChatTemplate.AdditionalMessages.Select(x => x.DeepClone()).ToList(), + Blocks = this.currentChatTemplate == default ? [] : this.currentChatTemplate.ExampleConversation.Select(x => x.DeepClone()).ToList(), }; } diff --git a/app/MindWork AI Studio/Components/Settings/SettingsPanelChatTemplates.razor.cs b/app/MindWork AI Studio/Components/Settings/SettingsPanelChatTemplates.razor.cs index 4a293a78..6abd4760 100644 --- a/app/MindWork AI Studio/Components/Settings/SettingsPanelChatTemplates.razor.cs +++ b/app/MindWork AI Studio/Components/Settings/SettingsPanelChatTemplates.razor.cs @@ -37,7 +37,7 @@ public partial class SettingsPanelChatTemplates : SettingsPanelBase { x => x.DataName, chatTemplate.Name }, { x => x.DataSystemPrompt, chatTemplate.SystemPrompt }, { x => x.IsEditing, true }, - {x => x.AdditionalMessages, chatTemplate.AdditionalMessages}, + {x => x.ExampleConversation, chatTemplate.ExampleConversation}, }; 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 05d4f6a8..a9ad14a3 100644 --- a/app/MindWork AI Studio/Dialogs/ChatTemplateDialog.razor +++ b/app/MindWork AI Studio/Dialogs/ChatTemplateDialog.razor @@ -66,7 +66,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 47398fbe..df823db8 100644 --- a/app/MindWork AI Studio/Dialogs/ChatTemplateDialog.razor.cs +++ b/app/MindWork AI Studio/Dialogs/ChatTemplateDialog.razor.cs @@ -42,7 +42,7 @@ public partial class ChatTemplateDialog : MSGComponentBase public bool IsEditing { get; init; } [Parameter] - public List AdditionalMessages { get; set; } = []; + public List ExampleConversation { get; set; } = []; [Inject] private ILogger Logger { get; init; } = null!; @@ -74,13 +74,13 @@ public partial class ChatTemplateDialog : MSGComponentBase Name = this.DataName, SystemPrompt = this.DataSystemPrompt, - AdditionalMessages = this.AdditionalMessages, + ExampleConversation = this.ExampleConversation, AllowProfileUsage = allowProfileUsage, }; private void RemoveMessage(ContentBlock item) { - this.AdditionalMessages.Remove(item); + this.ExampleConversation.Remove(item); } private void AddNewMessageToEnd() @@ -94,7 +94,7 @@ public partial class ChatTemplateDialog : MSGComponentBase Time = DateTimeOffset.Now, }; - this.AdditionalMessages.Add(newEntry); + this.ExampleConversation.Add(newEntry); } private void AddNewMessageBelow(ContentBlock currentItem) @@ -111,15 +111,15 @@ public partial class ChatTemplateDialog : MSGComponentBase }; // Rest of the method remains the same - var index = this.AdditionalMessages.IndexOf(currentItem); + var index = this.ExampleConversation.IndexOf(currentItem); if (index >= 0) { - this.AdditionalMessages.Insert(index + 1, newEntry); + this.ExampleConversation.Insert(index + 1, newEntry); } else { - this.AdditionalMessages.Add(newEntry); + this.ExampleConversation.Add(newEntry); } } diff --git a/app/MindWork AI Studio/Settings/ChatTemplate.cs b/app/MindWork AI Studio/Settings/ChatTemplate.cs index b56ca8e9..39c1271f 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 AdditionalMessages, bool AllowProfileUsage) +public readonly record struct ChatTemplate(uint Num, string Id, string Name, string SystemPrompt, List ExampleConversation, bool AllowProfileUsage) { private static string TB(string fallbackEN) => I18N.I.T(fallbackEN, typeof(ChatTemplate).Namespace, nameof(ChatTemplate)); @@ -13,7 +13,7 @@ public readonly record struct ChatTemplate(uint Num, string Id, string Name, str SystemPrompt = string.Empty, Id = Guid.Empty.ToString(), Num = uint.MaxValue, - AdditionalMessages = [], + ExampleConversation = [], AllowProfileUsage = true, };