mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-08-21 04:12:56 +00:00
Added initial description texts
This commit is contained in:
parent
ae678194f8
commit
f0e8eb49be
@ -108,6 +108,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
<ProfileSelection CurrentProfile="@this.currentProfile" CurrentProfileChanged="@this.ProfileWasChanged"/>
|
<ProfileSelection CurrentProfile="@this.currentProfile" CurrentProfileChanged="@this.ProfileWasChanged"/>
|
||||||
|
|
||||||
<ChatTemplateSelection CurrentChatTemplate="@this.currentChatTemplate" CurrentChatTemplateChanged="@this.ChatTemplateWasChanged"/>
|
<ChatTemplateSelection CurrentChatTemplate="@this.currentChatTemplate" CurrentChatTemplateChanged="@this.ChatTemplateWasChanged"/>
|
||||||
|
|
||||||
@if (PreviewFeatures.PRE_RAG_2024.IsEnabled(this.SettingsManager))
|
@if (PreviewFeatures.PRE_RAG_2024.IsEnabled(this.SettingsManager))
|
||||||
|
@ -60,6 +60,7 @@ public partial class ChatComponent : MSGComponentBase, IAsyncDisposable
|
|||||||
private string currentWorkspaceName = string.Empty;
|
private string currentWorkspaceName = string.Empty;
|
||||||
private Guid currentWorkspaceId = Guid.Empty;
|
private Guid currentWorkspaceId = Guid.Empty;
|
||||||
private CancellationTokenSource? cancellationTokenSource;
|
private CancellationTokenSource? cancellationTokenSource;
|
||||||
|
private bool disableProfile = false; // TODO
|
||||||
|
|
||||||
// Unfortunately, we need the input field reference to blur the focus away. Without
|
// Unfortunately, we need the input field reference to blur the focus away. Without
|
||||||
// this, we cannot clear the input field.
|
// this, we cannot clear the input field.
|
||||||
@ -328,6 +329,7 @@ public partial class ChatComponent : MSGComponentBase, IAsyncDisposable
|
|||||||
private async Task ChatTemplateWasChanged(ChatTemplate chatTemplate)
|
private async Task ChatTemplateWasChanged(ChatTemplate chatTemplate)
|
||||||
{
|
{
|
||||||
this.currentChatTemplate = chatTemplate;
|
this.currentChatTemplate = chatTemplate;
|
||||||
|
this.disableProfile = !chatTemplate.AllowProfileUsage;
|
||||||
if(this.ChatThread is null)
|
if(this.ChatThread is null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -813,6 +815,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_CHATTEMPLATE;
|
||||||
|
this.disableProfile = !this.currentChatTemplate.AllowProfileUsage;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
@inherits MSGComponentBase
|
@inherits MSGComponentBase
|
||||||
<MudTooltip Text="@T("You can switch between your chat templates here")" Placement="Placement.Top">
|
<MudTooltip Text="@T("You can switch between your chat templates here")" Placement="Placement.Top">
|
||||||
<MudMenu TransformOrigin="@Origin.BottomLeft" AnchorOrigin="Origin.TopLeft" StartIcon="@Icons.Material.Filled.Person4" EndIcon="@Icons.Material.Filled.KeyboardArrowDown" Label="@this.CurrentChatTemplate.Name" Variant="Variant.Filled" Color="Color.Default" Class="@this.MarginClass">
|
<MudMenu TransformOrigin="@Origin.BottomLeft" AnchorOrigin="Origin.TopLeft" StartIcon="@Icons.Material.Filled.RateReview" EndIcon="@Icons.Material.Filled.KeyboardArrowDown" Label="@this.CurrentChatTemplate.Name" Variant="Variant.Filled" Color="Color.Default" Class="@this.MarginClass">
|
||||||
@foreach (var chatTemplate in this.SettingsManager.ConfigurationData.ChatTemplates.GetAllChatTemplates())
|
@foreach (var chatTemplate in this.SettingsManager.ConfigurationData.ChatTemplates.GetAllChatTemplates())
|
||||||
{
|
{
|
||||||
<MudMenuItem OnClick="() => this.SelectionChanged(chatTemplate)">
|
<MudMenuItem OnClick="() => this.SelectionChanged(chatTemplate)">
|
||||||
|
@ -1,16 +1,18 @@
|
|||||||
@inherits SettingsPanelBase
|
@inherits SettingsPanelBase
|
||||||
|
|
||||||
<ExpansionPanel HeaderIcon="@Icons.Material.Filled.Person4" HeaderText="@T("Configure Chat Templates")">
|
<ExpansionPanel HeaderIcon="@Icons.Material.Filled.RateReview" HeaderText="@T("Configure Chat Templates")">
|
||||||
<MudText Typo="Typo.h4" Class="mb-3">
|
<MudText Typo="Typo.h4" Class="mb-3">
|
||||||
@T("Your Chat Templates")
|
@T("Your Chat Templates")
|
||||||
</MudText>
|
</MudText>
|
||||||
|
|
||||||
<MudJustifiedText Typo="Typo.body1" Class="mb-3">
|
<MudJustifiedText Typo="Typo.body1" Class="mb-3">
|
||||||
@T("Explain chat Templates TODO")
|
@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.")
|
||||||
</MudJustifiedText>
|
</MudJustifiedText>
|
||||||
|
|
||||||
<MudJustifiedText Typo="Typo.body1" Class="mb-3">
|
<MudJustifiedText Typo="Typo.body1" Class="mb-3">
|
||||||
@T("Explain chat Templates TODO")
|
@T("Note: This advanced feature is designed for users familiar with prompt engineering concepts.")
|
||||||
</MudJustifiedText>
|
</MudJustifiedText>
|
||||||
|
|
||||||
<MudTable Items="@this.SettingsManager.ConfigurationData.ChatTemplates" Hover="@true" Class="border-dashed border rounded-lg">
|
<MudTable Items="@this.SettingsManager.ConfigurationData.ChatTemplates" Hover="@true" Class="border-dashed border rounded-lg">
|
||||||
<ColGroup>
|
<ColGroup>
|
||||||
<col style="width: 3em;"/>
|
<col style="width: 3em;"/>
|
||||||
|
@ -5,17 +5,15 @@
|
|||||||
|
|
||||||
<MudDialog>
|
<MudDialog>
|
||||||
<DialogContent>
|
<DialogContent>
|
||||||
<MudJustifiedText Typo="Typo.body1" Class="mb-3">
|
|
||||||
@T("Store chat templates.")
|
|
||||||
</MudJustifiedText>
|
|
||||||
|
|
||||||
<MudJustifiedText Typo="Typo.body1" Class="mb-3">
|
<MudJustifiedText Typo="Typo.body1" Class="mb-3">
|
||||||
@T("Are you always using the same prompts and want a way of automatically using them?")
|
@T("Create your custom chat template to tailor the LLM's behavior for specific tasks or domains. Define a custom system prompt and provide example exchanges to design an AI experience perfectly suited to your requirements.")
|
||||||
</MudJustifiedText>
|
</MudJustifiedText>
|
||||||
|
|
||||||
<MudJustifiedText Typo="Typo.body1" Class="mb-3">
|
<MudJustifiedText Typo="Typo.body1" Class="mb-3">
|
||||||
@T("The name of the chat template is mandatory. Each chat template must have a unique name.")
|
@T("The name of the chat template is mandatory. Each chat template must have a unique name.")
|
||||||
</MudJustifiedText>
|
</MudJustifiedText>
|
||||||
|
|
||||||
<MudForm @ref="@this.form" @bind-IsValid="@this.dataIsValid" @bind-Errors="@this.dataIssues">
|
<MudForm @ref="@this.form" @bind-IsValid="@this.dataIsValid" @bind-Errors="@this.dataIssues">
|
||||||
@* ReSharper disable once CSharpWarnings::CS8974 *@
|
@* ReSharper disable once CSharpWarnings::CS8974 *@
|
||||||
<MudTextField
|
<MudTextField
|
||||||
@ -51,14 +49,17 @@
|
|||||||
HelperText="@T("Tell the AI your system prompt.")"
|
HelperText="@T("Tell the AI your system prompt.")"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<MudSwitch @bind-Value="allowProfileUsage" Color="Color.Primary" Label="@T("Allow using profiles together with this chat template?")"/>
|
<MudSwitch @bind-Value="allowProfileUsage" Color="Color.Primary" Class="mb-3" Label="@T("Allow the use of profiles together with this chat template?")" ThumbIcon="@Icons.Material.Filled.Person4" ThumbIconColor="Color.Default"/>
|
||||||
|
|
||||||
<MudText> What should you know about the additional messages? TODO</MudText>
|
<MudText Typo="Typo.h6" Class="mb-3">
|
||||||
|
@T("Example Exchanges")
|
||||||
|
</MudText>
|
||||||
|
|
||||||
<MudTable FixedHeader="true" Items="@AdditionalMessages" RowEditPreview="BackupItem" RowEditCancel="ResetItemToOriginalValues" RowEditCommit="ItemHasBeenCommitted" CanCancelEdit="true" CommitEditTooltip="@T("Commit Changes")" Elevation="10" Outlined="true" >
|
<MudJustifiedText Typo="Typo.body1" Class="mb-3">
|
||||||
<ToolBarContent>
|
@T("Add example exchanges (user prompt followed by assistant response) 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.")
|
||||||
<MudText Typo="Typo.h6">Additional messages</MudText>
|
</MudJustifiedText>
|
||||||
</ToolBarContent>
|
|
||||||
|
<MudTable FixedHeader="true" Items="@AdditionalMessages" RowEditPreview="BackupItem" RowEditCancel="ResetItemToOriginalValues" RowEditCommit="ItemHasBeenCommitted" CanCancelEdit="true" CommitEditTooltip="@T("Commit Changes")" Elevation="10" Outlined="true" Class="mt-3 mb-6">
|
||||||
<ColGroup>
|
<ColGroup>
|
||||||
<col style="width: 20%;" />
|
<col style="width: 20%;" />
|
||||||
<col style="width: 65%;" />
|
<col style="width: 65%;" />
|
||||||
@ -70,7 +71,7 @@
|
|||||||
<MudTh Style="text-align:center">Actions</MudTh>
|
<MudTh Style="text-align:center">Actions</MudTh>
|
||||||
</HeaderContent>
|
</HeaderContent>
|
||||||
<RowTemplate>
|
<RowTemplate>
|
||||||
<MudTd DataLabel="@T("Role")">@context.Role</MudTd>
|
<MudTd DataLabel="@T("Role")">@context.Role.ToChatTemplateName()</MudTd>
|
||||||
<MudTd DataLabel="@T("Message")">
|
<MudTd DataLabel="@T("Message")">
|
||||||
@(context.Content is ContentText textContent ? textContent.Text : context.Content?.ToString())
|
@(context.Content is ContentText textContent ? textContent.Text : context.Content?.ToString())
|
||||||
</MudTd>
|
</MudTd>
|
||||||
@ -101,12 +102,12 @@
|
|||||||
</MudTd>
|
</MudTd>
|
||||||
</RowEditingTemplate>
|
</RowEditingTemplate>
|
||||||
<PagerContent>
|
<PagerContent>
|
||||||
<MudTablePager RowsPerPageString="Messages per page" PageSizeOptions="[20,50,100]"/>
|
<MudTablePager RowsPerPageString="Messages per page" PageSizeOptions="[10,20,50,100]"/>
|
||||||
</PagerContent>
|
</PagerContent>
|
||||||
</MudTable>
|
</MudTable>
|
||||||
</MudForm>
|
</MudForm>
|
||||||
|
|
||||||
<MudButton Color="Color.Primary" Variant="Variant.Filled" OnClick="AddNewMessageToEnd" StartIcon="@Icons.Material.Filled.Add">@T("Add additional message")</MudButton>
|
<MudButton Color="Color.Primary" Variant="Variant.Filled" OnClick="AddNewMessageToEnd" StartIcon="@Icons.Material.Filled.Add" Class="mb-3">@T("Add additional message")</MudButton>
|
||||||
|
|
||||||
<Issues IssuesData="@this.dataIssues"/>
|
<Issues IssuesData="@this.dataIssues"/>
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
|
@ -200,8 +200,8 @@ public partial class ChatTemplateDialog : MSGComponentBase
|
|||||||
|
|
||||||
private string? ValidateSystemPrompt(string text)
|
private string? ValidateSystemPrompt(string text)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrWhiteSpace(this.DataSystemPrompt))// && string.IsNullOrWhiteSpace(this.DataActions))
|
// if (string.IsNullOrWhiteSpace(this.DataSystemPrompt))// && string.IsNullOrWhiteSpace(this.DataActions))
|
||||||
return T("Please enter the system prompt.");
|
// return T("Please enter the system prompt.");
|
||||||
|
|
||||||
if(text.Length > 444)
|
if(text.Length > 444)
|
||||||
return T("The text must not exceed 444 characters.");
|
return T("The text must not exceed 444 characters.");
|
||||||
|
Loading…
Reference in New Issue
Block a user