Rename NO_CHATTEMPLATE to NO_CHAT_TEMPLATE.

This commit is contained in:
Thorsten Sommer 2025-05-24 18:06:50 +02:00
parent e64d8163eb
commit 8ac19d6dda
Signed by untrusted user who does not match committer: tsommer
GPG Key ID: 371BBA77A02C0108
7 changed files with 8 additions and 9 deletions

View File

@ -89,7 +89,7 @@ public abstract partial class AssistantBase<TSettings> : AssistantLowerBase wher
protected MudForm? form; protected MudForm? form;
protected bool inputIsValid; protected bool inputIsValid;
protected Profile currentProfile = Profile.NO_PROFILE; protected Profile currentProfile = Profile.NO_PROFILE;
protected ChatTemplate currentChatTemplate = ChatTemplate.NO_CHATTEMPLATE; protected ChatTemplate currentChatTemplate = ChatTemplate.NO_CHAT_TEMPLATE;
protected ChatThread? chatThread; protected ChatThread? chatThread;
protected IContent? lastUserPrompt; protected IContent? lastUserPrompt;
protected CancellationTokenSource? cancellationTokenSource; protected CancellationTokenSource? cancellationTokenSource;

View File

@ -104,7 +104,7 @@ public sealed record ChatThread
systemPromptTextWithChatTemplate = chatThread.SystemPrompt; systemPromptTextWithChatTemplate = chatThread.SystemPrompt;
else 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; systemPromptTextWithChatTemplate = chatThread.SystemPrompt;
else else
{ {

View File

@ -46,7 +46,7 @@ public partial class ChatComponent : MSGComponentBase, IAsyncDisposable
private DataSourceSelection? dataSourceSelectionComponent; private DataSourceSelection? dataSourceSelectionComponent;
private DataSourceOptions earlyDataSourceOptions = new(); private DataSourceOptions earlyDataSourceOptions = new();
private Profile currentProfile = Profile.NO_PROFILE; private Profile currentProfile = Profile.NO_PROFILE;
private ChatTemplate currentChatTemplate = ChatTemplate.NO_CHATTEMPLATE; private ChatTemplate currentChatTemplate = ChatTemplate.NO_CHAT_TEMPLATE;
private bool hasUnsavedChanges; private bool hasUnsavedChanges;
private bool mustScrollToBottomAfterRender; private bool mustScrollToBottomAfterRender;
private InnerScrolling scrollingArea = null!; private InnerScrolling scrollingArea = null!;
@ -804,7 +804,7 @@ public partial class ChatComponent : MSGComponentBase, IAsyncDisposable
{ {
this.currentChatTemplate = this.SettingsManager.ConfigurationData.ChatTemplates.FirstOrDefault(x => x.Id == chatChatTemplate); this.currentChatTemplate = this.SettingsManager.ConfigurationData.ChatTemplates.FirstOrDefault(x => x.Id == chatChatTemplate);
if(this.currentChatTemplate == default) if(this.currentChatTemplate == default)
this.currentChatTemplate = ChatTemplate.NO_CHATTEMPLATE; this.currentChatTemplate = ChatTemplate.NO_CHAT_TEMPLATE;
} }
} }

View File

@ -7,7 +7,7 @@ namespace AIStudio.Components;
public partial class ChatTemplateSelection : MSGComponentBase public partial class ChatTemplateSelection : MSGComponentBase
{ {
[Parameter] [Parameter]
public ChatTemplate CurrentChatTemplate { get; set; } = ChatTemplate.NO_CHATTEMPLATE; public ChatTemplate CurrentChatTemplate { get; set; } = ChatTemplate.NO_CHAT_TEMPLATE;
[Parameter] [Parameter]
public EventCallback<ChatTemplate> CurrentChatTemplateChanged { get; set; } public EventCallback<ChatTemplate> CurrentChatTemplateChanged { get; set; }

View File

@ -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)); 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"), Name = TB("Use no chat template"),
SystemPrompt = string.Empty, SystemPrompt = string.Empty,
@ -34,5 +34,4 @@ public readonly record struct ChatTemplate(uint Num, string Id, string Name, str
return this.SystemPrompt; return this.SystemPrompt;
} }
} }

View File

@ -273,7 +273,7 @@ public sealed class SettingsManager
return preselection; return preselection;
preselection = this.ConfigurationData.ChatTemplates.FirstOrDefault(x => x.Id == this.ConfigurationData.App.PreselectedChatTemplate); 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) public ConfidenceLevel GetConfiguredConfidenceLevel(LLMProviders llmProvider)

View File

@ -6,7 +6,7 @@ public static class ChatTemplateExtensions
{ {
public static IEnumerable<ChatTemplate> GetAllChatTemplates(this IEnumerable<ChatTemplate> chatTemplates) public static IEnumerable<ChatTemplate> GetAllChatTemplates(this IEnumerable<ChatTemplate> chatTemplates)
{ {
yield return ChatTemplate.NO_CHATTEMPLATE; yield return ChatTemplate.NO_CHAT_TEMPLATE;
foreach (var chatTemplate in chatTemplates) foreach (var chatTemplate in chatTemplates)
yield return chatTemplate; yield return chatTemplate;
} }