Fixed the distance between profile and the justified text. Furthermore, I fixed a bug where the predefined user input didnt show up.

This commit is contained in:
Peer Schütt 2025-07-10 18:35:15 +02:00
parent faa5b3703d
commit ce0ab7a380
2 changed files with 6 additions and 11 deletions

View File

@ -80,6 +80,7 @@ public partial class ChatComponent : MSGComponentBase, IAsyncDisposable
// Get the preselected chat template:
this.currentChatTemplate = this.SettingsManager.GetPreselectedChatTemplate(Tools.Components.CHAT);
this.userInput = this.currentChatTemplate.PredefinedUserPrompt;
//
// Check for deferred messages of the kind 'SEND_TO_CHAT',
@ -272,7 +273,7 @@ public partial class ChatComponent : MSGComponentBase, IAsyncDisposable
}
}
private bool CanThreadBeSaved => this.ChatThread is not null && this.ChatThread.Blocks.Count > 0;
private bool CanThreadBeSaved => this.ChatThread is not null && this.ChatThread.Blocks.Any(b => !b.HideFromUser);
private string TooltipAddChatToWorkspace => string.Format(T("Start new chat in workspace '{0}'"), this.currentWorkspaceName);
@ -326,6 +327,7 @@ public partial class ChatComponent : MSGComponentBase, IAsyncDisposable
private async Task ChatTemplateWasChanged(ChatTemplate chatTemplate)
{
this.currentChatTemplate = chatTemplate;
this.userInput = this.currentChatTemplate.PredefinedUserPrompt;
if(this.ChatThread is null)
return;
@ -673,9 +675,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;
}
this.userInput = this.currentChatTemplate.PredefinedUserPrompt;
// Now, we have to reset the data source options as well:
this.ApplyStandardDataSourceOptions();

View File

@ -59,11 +59,9 @@
<MudText Typo="Typo.h6" Class="mb-3 mt-6">
@T("Predefined User Input")
</MudText>
<MudJustifiedText Typo="Typo.body1" Class="mb-3">
<MudJustifiedText Class="mb-3" Typo="Typo.body1">
@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.")
</MudJustifiedText>
<MudTextField
T="string"
@bind-Text="@this.PredefinedUserPrompt"
@ -83,8 +81,7 @@
<MudText Typo="Typo.h6" Class="mb-3 mt-6">
@T("Profile Usage")
</MudText>
<MudJustifiedText Class="mt-6" Typo="Typo.body1">
<MudJustifiedText Class="mb-3" Typo="Typo.body1">
@T("Using some chat templates in tandem with profiles might cause issues. Therefore, you might prohibit the usage of profiles here.")
</MudJustifiedText>
<MudTextSwitch @bind-Value="@this.AllowProfileUsage" Color="Color.Primary" Label="@T("Allow the use of profiles together with this chat template?")" LabelOn="@T("Yes, allow profiles when using this template")" LabelOff="@T("No, prohibit profile use for this template")" />
@ -92,12 +89,9 @@
<MudText Typo="Typo.h6" Class="mb-3 mt-6">
@T("Example Conversation")
</MudText>
<MudJustifiedText Typo="Typo.body1" Class="mb-3">
@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.")
</MudJustifiedText>
<MudTable Items="@this.dataExampleConversation" FixedHeader="true" Hover="true" Class="mt-3 mb-3" CanCancelEdit="true" CancelEditTooltip="@T("Cancel")" CommitEditTooltip="@T("Commit Changes")" Outlined="true" RowEditCancel="@this.ResetItem" RowEditPreview="@this.BackupItem" EditTrigger="TableEditTrigger.RowClick" IsEditRowSwitchingBlocked="false" RowEditCommit="@this.CommitInlineEdit">
<ColGroup>
<col style="width: 10em;" />